-
Notifications
You must be signed in to change notification settings - Fork 1
debug getting started
R41z0r edited this page Mar 8, 2026
·
1 revision
Use this module when your addon needs explicit debug sessions and timeline-based bug reports.
local Debug = LibStub("LibEQOLDebugMode-1.0")Embed include (optional module):
<Include file="libs/LibEQOL/LibEQOLDebugMode.xml" />MyAddonDebugDB = MyAddonDebugDB or {}
Debug:RegisterAddon("MyAddon", {
tier = "deep", -- default is "off"
persistence = {
enabled = true,
savedRoot = MyAddonDebugDB,
path = { "Debug", "Sessions" }, -- or "Debug.Sessions"
},
limits = {
maxEventsPerSession = 500,
maxSessions = 10,
maxPayloadBytes = 4096,
maxSpanDepth = 32,
},
})local sessionId, err = Debug:StartSession("MyAddon")
if not sessionId then
print("Debug start failed:", err)
return
end
-- ...capture calls...
Debug:StopSession("MyAddon", "manual-stop")Without an active session, capture calls are hard no-ops.
Debug:Trace("MyAddon", "OpenConfig", { tab = "General" })
local spanId = Debug:BeginSpan("MyAddon", "ApplyProfile", { profile = "Raid" })
Debug:Trace("MyAddon", "ValidateData")
Debug:CaptureError("MyAddon", "LoadProfile", "invalid profile id")
Debug:EndSpan("MyAddon", spanId, "error")local wrapped = Debug:Wrap("MyAddon", "ImportProfile", function(profileString)
return ImportProfile(profileString)
end, {
rethrow = false,
})
local ok, importErr = wrapped("...")
if not ok and importErr then
print("Import failed:", importErr)
endlocal report, text, exportErr = Debug:BuildReport("MyAddon")
if not report then
print("Export failed:", exportErr)
return
end
print(text) -- copy/paste into bug reportSee full API details on debug-api.