promotional bannermobile promotional banner

OAP Debug

A debug window for addon authors: per-addon log, live table and frame inspector, a frame picker, performance graphs for every addon, and Lua errors filed under the addon they came from.
item image
item image
item image
item image
item image
item image
item image

Description

OAP Debug is a debug and inspection window for World of Warcraft addons. Addons that find it installed register with it and send their log lines, the tables they want to look at, timings and counts, and copies of their chat output - each addon in its own colour, in one window. When it is not installed, those addons carry on exactly as before.

It is the workbench behind the OAP addons (OAP UnitButtons, OAP Dungeon Maps, OAP Party Utilities, OAP Spell Stats, OAP Gear Helper), and any addon can use it: a few lines of Lua, shown in its manual. Some parts - the Perf tab and the frame picker - are useful with no other addon at all.

Made for WoW Forever. (OAP: Old Age Pensioner. Written by one, for my own addons.)

OAP Lizzard Tested in OAP Lizzard. Before I try a change in game, it's visually tested in OAP Lizzard, my own tool that runs addon interface code outside the game. The last test is always in WoW Forever itself.

The OAP Debug window: addons down the left, a tab per job

The tabs

  • Log - every registered addon's log lines, by level (error, warn, info, debug), with a find box and a level filter. Tables and frames named in a line are blue links: click one to open it. Keep 1,000 to 20,000 lines, as you choose.
  • Inspect - Lua tables and functions as a tree you click to open, as deep as you like. Type any global name or expression to look at it live.
  • Frames - a frame inspector: the hierarchy from the top level down, and the selected frame's size, points, scripts and regions. Hover a row and that frame is outlined on screen. Search everything under a frame by name or type, and show a hidden frame to see where it is. Each texture has a small picture of its art beside its name. It refreshes every second, so frames that come and go show up by themselves.
  • Art - every picture in a frame as a grid, with an editor to change them in place (below).
  • Perf - frame rate, latency, Lua memory and memory growth as charts over the last five minutes, and a table of every loaded addon: memory, its share, a five-minute trend line, and CPU when the game's addon profiler is on. Sort by any column.
  • Metrics - the timers, counters and gauges that registered addons send themselves, with bars and small graphs of recent values.
  • Chat - copies of what each addon printed to chat, kept apart from the game's chat.
  • Events - name any game event (UNIT_AURA, BAG_UPDATE …) and see each time it fires, with everything it carried. Not sure of the name? Type part of it and pick from the game's own list. The Last event window shows the newest firing with every table opened out. Click a table to open it: it is a copy taken the moment the event fired. Blizzard's own /etrace logs every event but shows a table only as a number.
  • Errors - Lua errors, warnings and blocked actions, filed under the addon they came from, with the stack. Repeats are counted, not listed again.

The Perf tab: live charts and every addon's memory and CPU

Pick any frame on screen

Pick frame (or /oapd pick) outlines whatever is under the mouse. The mouse wheel climbs to its parent and on up, stopping below the whole screen; a click opens it on the Frames tab. Hold Ctrl to include frames that ignore the mouse.

Picking a frame: the outline, and its parents listed above

See the art, and the Lua that makes it

Select a texture on the Frames tab and its art shows larger, with the atlas name or file number it comes from, the part of the file used, its colour and blend - and beside it the Lua that makes the same picture, ready to copy into your own addon. To find a picture on screen, outline its button or window with the frame picker and hold Shift: the pictures inside it are listed, the ones under the mouse first, and a click opens one.

Try a new look on the Art tab

The Art tab (/oapd art, or open it after picking or selecting a frame) shows all of a window's pictures in one grid: its own first, then those of the frames inside it. Hover one to outline it on screen; click it to change it in place:

  • What it draws - an atlas name, file number or file path, and the part of the file used.
  • Size, alpha, colour, blend and layer, shown or hidden, desaturated. Type a value, or roll the mouse wheel over a number to nudge it.
  • Anchors - hover the anchor line to see the frame it is attached to outlined, with a dot on the exact point.
  • Solo makes every other picture see-through, so you see the one you are editing alone.
  • Undo and Undo all put everything back exactly, and the Lua below shows the picture as it is now, ready to copy into your own addon.

Changes last until /reload, and nothing is changed in combat.

The Art tab: a window's pictures, one being edited

Watch values live

The Watch window shows chosen values updating a few times a second, and a value that changes flashes yellow. Watch a table, a frame, or any expression (/oapd watch); addons can add their own watches too.

The Watch window: values flashing as they change

Each addon's debug setting

OAP addons have an "OAP Debug" setting in their own options: Errors only, Normal, Normal + metrics or Detailed - how much they send. OAP Debug shows each addon's setting under its name, and the Addons page in Options lists every addon with its setting, Lua errors and log lines.

Handy touches

  • Compact view - hide the sidebar and title bar for a small window you can keep open.
  • Pin - a pinned window (or the Watch window) stays open when Escape, the game menu or Options would close it.
  • Copy anything - every text area can be selected and copied with Ctrl+C.
  • After a big game update (a new interface number) OAP Debug tells you once at login that it was tested on an earlier build, so you know why something might not work.
  • A full manual in Options > AddOns > OAP Debug > Help, in plain words: how to use it when an addon misbehaves, how to write a bug report, and a Developer usage page with Lua to copy, in editor colours.
  • Settings (minimap button, compact view, pins, log size) are kept between sessions. Shift-click the minimap button for the Options pages.

For addon authors

Everything goes through one global table, OAPDebug, and every call catches its own errors. List it as an optional dependency, keep the calls in one small file of your addon, and check it is there before calling - your addon then works the same with or without it:

## OptionalDeps: OAPDebug
local D = OAPDebug
if D then
    D.Register("MyAddon", { title = "My Addon", folder = "MyAddon" })
    D.Log("MyAddon", "built {1} buttons for {2}", "info", count, frame)
end

The in-game Developer usage page has the full pattern, including an "OAP Debug" level setting (errors only, normal, normal + metrics, detailed) so players choose how much is sent, and how to show that setting in OAP Debug.

Good to know

  • Made for WoW Forever, using the Retail API. It also loads on Retail, from the same download.
  • The game now hides some answers from addons. Where it does, OAP Debug shows <SECRET> and a warning icon, and lists what was hidden, rather than failing.
  • Lua errors are kept for addons that work with OAP Debug. To keep every addon's errors too, tick "Also keep Lua errors from other addons" in its Options: they go on their own Other tab. OAP Debug passes every error on, so the game's own error display (or your error addon) still works.
  • Nothing is sent anywhere. At logout the log, chat, errors and a Perf report are written to the addon's saved file, for reading outside the game.
  • The manual is in Options > AddOns > OAP Debug > Help, and /oapd help lists the commands.

OAP Debug Team

profile avatar
Owner
  • 1
    Followers
  • 5
    Projects
  • 490
    Downloads

More from sulobinView all