Improve debug cache feature
rdw-software opened this issue ยท 1 comments
This is just a list to brainstorm possible improvements to the currently very basic feature.
Functionality:
- Print memory usage
- Filter and show messages by category only
- Show in separate window OR add a GUI browser to read debug messages more easily
- Copy & Paste from a new window
Formatting:
- Better documentation
Optimization
- Performance? Memory footprint, profiling impact... maybe add a toggle to disable the queue entirely? Ideal default cache size?
- Using
tremove
isn't efficient for more than a few hundred messages... should be okay, though? - Use = nil instead of
tremove
(recommended by Lua authors) - No need to set and store the default category. In fact,
- Don't save redundant data; but store categories by index/name instead?
Addon-specific
- Store last debug log in saved variables (meh) - would easier to copy/paste, but I don't like it
- Add more slash commands
- Add usage to README and FAQ?
- Add setting to config GUI
- Disable in release versions? (kind of defeats the point... maybe disable in release and enable for alpha/beta if there is a setting?)
- Move reason from debug msg text to category field
- Rework slash command dump - variable number of messages
I don't even remember what half of these were about. But here's my updated evaluation of the main concerns.
Memory usage
- The cache currently stores 250 messages (lines), which would be 256 characters per line in the worst case
- So that's 256*250 = 62 KB plus some bookkeeping / table metadata and other overhead
- That is to say, the increased memory usage for this rather useful feature seems more than acceptable
- It's still possible to limit the cache size or even disable it altogether, albeit not exposed to the UI currently
Usability
- Debug messages being output to the default ChatFrame is awkward from a UX perspective
- It requires people to take screenshots to report issues, which is impractical and not searchable either
- Filtering by category would be neat, but there's only Debug and Profiling right now - so that's a meh at best
- Copy/paste is a great improvement and I have something working (prototype, needs cleanup)
Documentation
Definitely should be documented better since no one who wants to report an issue knows of this feature.