-
Notifications
You must be signed in to change notification settings - Fork 1
debug api
local Debug = LibStub("LibEQOLDebugMode-1.0")Umbrella access (if present):
local Debug = LibEQOL and LibEQOL.DebugModeRegisters (or updates) one isolated addon tenant.
-
addonKey(string, required) -
config(table, optional)
Returns: true on success, or nil, err.
Config schema:
{
tier = "off" | "basic" | "deep", -- default: "off"
persistence = {
enabled = true|false, -- default: false
savedRoot = table, -- required when enabled=true
path = { "A", "B" } or "A.B", -- required when enabled=true
},
limits = {
maxEventsPerSession = number, -- default: 500
maxSessions = number, -- default: 10
maxPayloadBytes = number, -- default: 4096
maxSpanDepth = number, -- default: 32
},
}Stops an active session (if any) and removes the addon tenant.
Returns: true or nil, err.
Updates tier (off, basic, deep).
Returns: normalized tier or nil, err.
Returns current tier or nil if addon is not registered.
Explicitly activates capture for one addon key.
- Fails if addon is not registered.
- Fails when tier is
off. - Fails when another session for that addon key is active.
- Validates persistence path when persistence is enabled.
opts:
{ tier = "off" | "basic" | "deep" } -- optional tier override for this session startReturns: sessionId or nil, err.
Stops active session, auto-closes remaining open spans (deep mode), stores session in ringbuffer, and flushes persistence.
Returns: sessionId (and optionally persistence error as second value).
Returns true/false.
Returns sessionId or nil.
All capture APIs hard early-exit if there is no active session.
Adds breadcrumb/trace event.
Returns: eventId or nil.
Adds error event.
Returns: eventId or nil.
Deep-mode only. Opens a hierarchical span.
Returns: spanId or nil.
Deep-mode only. Closes a span.
Returns: eventId of the closing event or nil.
Returns a wrapped function that captures thrown errors via xpcall.
opts:
{
rethrow = true|false, -- default: true
span = true|false, -- default: true (deep mode only)
spanPayload = any,
errorPayload = any,
parentId = number,
}Returns: wrappedFn or nil, err when fn is invalid.
Returns a structured timeline table for one session.
opts:
{
sessionId = number, -- explicit session
latestStored = true, -- pick latest stored (ignore active)
}Default: active session if available, otherwise latest stored session.
Returns: timelineTable or nil, err.
Builds a structured report plus a copy-ready text report.
Returns: reportTable, reportText or nil, nil, err.
Drops in-memory active session without storing it.
Returns: true or nil, err.
Clears stored session history for the addon key and flushes persistence.
Returns: true or nil, err.