Today marks the release of the DebugLogViewer and LibDebugLogger 1.1. Together these two will provide authors with a powerful new way to find and fix bugs in their add-ons locally and out in the wild.
But the log viewer is not just for authors. It is also very useful for regular players, as it will for example suppress Lua error pop-ups and instead present them in a non-intrusive manner.
The new version of the library now captures chat output made via the in-game debug functions, error alert messages and loading screen occurrences. It also provides some callbacks so other add-ons like the log viewer can react to modifications of the log data.
Any add-on can use LibDebugLogger to create custom log output and users can then send the LibDebugLogger saved variables file to the author when they encounter a problem. The logged data will make identifying the cause of a bug easier than ever.
Check the description to see how to introduce LibDebugLogger into your add-on.
Debug Log Viewer
The Debug Log Viewer consists of three major parts.
The first thing you will notice after installing it, is the new “quick log” window. It will appear in the bottom right corner of your screen and can be configured to show parts or all of the latest entries in the debug log.
For the convenience of regular players, it is pre-configured to hide entries in the debug category and also those generated by LibDebugLogger itself. As already mentioned, LibDebugLogger will now capture chat debug messages. To avoid having them shown twice, they will be filtered from the chat automatically and instead show in the quick log. Authors can opt to use the new LibChatMessage in order to avoid abusing the chat debug function and instead use proper system messages. That way they will be shown in chat regardless.
Clicking on the time or tag of a message will open a detail view for the selected message. In case a message contains an item link or similar, the link can be clicked like for regular chat messages.
The settings menu allows you to configure the quick log, log viewer and LibDebugLogger. You can change the colours used for the different log levels, and more.
The most important part is the log viewer itself. It is a new window that can be opened via the /logviewer command, a key bind or the context menu of the quick log.
It shows all log entries in a list and allows to filter them by several criteria. When an entry is clicked, it will open a pop-up with the full formatted output and – in case the setting is activated in LibDebugLogger – it will also show the stack trace for the message. The list can be filtered by log level, time frame and entry tags.