Quantcast
Download
(5 Kb)
Download
Updated: 03/16/19 04:39 AM
Compatibility:
Wrathstone (4.3)
Updated:03/16/19 04:39 AM
Created:02/26/19 10:22 AM
Monthly downloads:1,915
Total downloads:1,920
Favorites:3
MD5:
4.3
LibDebugLogger
Version: 1.0.2
by: sirinsidiator [More]
This library provides facilities to log debug output in the background without running the risk of it showing in the chat output. It can also be very helpful in debugging issues out in the wild, since it will store the output into its saved variable file. It will automatically log information about the logged in character, loaded addons and Lua errors. During startup the library will default to log all log levels and stack traces, until the saved variables become available.

A separate addon to view logs ingame is currently being worked on, but it is not ready yet.

The /debuglogger slashcommand can be used to configure what should get logged.

/debuglogger stack <on/off> - when turned on, the library will log the stacktrace for the logger call. Can be very useful to figure out where a log is coming from.

/debuglogger level <d(ebug)/i(nfo)/w(arning)/e(rror)> - determines the minimum severity for logs to be stored

/debuglogger clear - will delete all stored logs

LibDebugLogger will automatically remove old logs after one day, or when the total amount surpasses 10k entries.

API:
LibDebugLogger.Create
This function will return an instance of a logger. Anything logged via that instance will automatically contain the tag for easy identification.

Lua Code:
  1. local logger = LibDebugLogger.Create("MyAddon")
  2. -- or --
  3. local logger = LibDebugLogger("MyAddon")

Logger:Create
Convenience method to create a new instance of the logger with a combined tag. Can be used to separate logs from different files. Anything logged via that instance will automatically contain the parent tag and the child tag separated by a slash (e.g. MyAddon/SomeFile).

Lua Code:
  1. local subLogger = logger:Create("SomeFile")


Logger:SetEnabled
Setter to turn this logger of so it no longer adds anything to the log when one of its log methods is called.

Lua Code:
  1. logger:SetEnabled(false)

Logger:Debug
Method to log messages with the debug log level. If the first argument is a formatting string, the method will call string.format, otherwise each argument will get passed through tostring and concatenated with a space.

Lua Code:
  1. logger:Debug("My formatted message: %s", "some text")
  2. logger:Debug("My", "combined", "message")

Logger:Info
Method to log messages with the info log level. See Debug method for details.

Logger:Warn
Method to log messages with the warning log level. See Debug method for details.

Logger:Error
Method to log messages with the error log level. See Debug method for details.
v1.0.2
- prune log during session before it grows too big to load on next login
- store identical messages following after one another only once and start counting afterwards
- some minor code and performance improvements

v1.0.1
- added a safeguard to ensure logging an error won't ever create more errors
- added more debug information to startup log (e.g. platform, ui, addon paths, ...)
- fixed LibDebugLogger("MyAddon") passing the wrong argument as tag
Archived Files (2)
File Name
Version
Size
Uploader
Date
1.0.1
4kB
sirinsidiator
03/04/19 12:10 PM
1.0.0
4kB
sirinsidiator
02/26/19 10:22 AM


Post A Reply Comment Options
Unread 03/16/19, 04:40 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 737
Uploads: 32
Thanks to everyone who sent in their files I was able to identify the problem. Turned out that it is caused by other addons that throw a large number of errors and fill up the LibDebugLogger saved variables until the game can no longer load it. I have updated LibDebugLogger so it keeps its log at a manageable size during the session instead of only removing surplus entries at login.
The two addons I have identified so far are BugCatcher and LUI Extended. I have contacted the author of LUI Extended and the error there should be fixed soon. BugCatcher seems to be abandoned and you should probably disable it, as it is throwing multiple errors per frame, which can have a severe impact on the game performance.
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 03:45 PM  
StytchFingal

Forum posts: 0
File comments: 18
Uploads: 0
Deleting the lua file from Saved Variables also worked for me. Thank you!

Before the delete, the DebugLogger was crashing me back to the login screen from any attempt at character load.
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 02:52 PM  
Seminolegirl1992

Forum posts: 0
File comments: 5
Uploads: 0
Re: Re: Not working for me

Originally Posted by sirinsidiator
Have you tried to remove the LibDebugLogger.lua from your Saved Variables folder? Does it work then?
Otherwise I need more information. More specifically the operating system you are using and any errors or other unusual entries in the interface.log file in live/Logs.
Omg it worked!!!!!!! You are amazing. Thanks a million times for responding.
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 01:25 PM  
mausibox01

Forum posts: 0
File comments: 1
Uploads: 0
hey there,
I had the same issue as written below but to delete the debuglogger.lua from saved variables works fine for me. thanks for that. appriciate your fast response to that question.
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 01:10 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1192
File comments: 737
Uploads: 32
Re: Not working for me

Have you tried to remove the LibDebugLogger.lua from your Saved Variables folder? Does it work then?
Otherwise I need more information. More specifically the operating system you are using and any errors or other unusual entries in the interface.log file in live/Logs.
__________________
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 01:05 PM  
Seminolegirl1992

Forum posts: 0
File comments: 5
Uploads: 0
Not working for me

Hiya. I posted on Awesome Guild Store's comment section a few days back...I finally isolated my issue to this library precisely, but I am unsure how to fix it. Every other lib works fine, as does AGS, but when I select this lib to load, it crashes back to log-in screen. Any ideas on how to fix this? I know most people have this add-on and its libraries working fine, so it's probably only on my end. Thanks!!
Report comment to moderator  
Reply With Quote
Unread 03/02/19, 02:26 PM  
Architecture
 
Architecture's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 70
Uploads: 8
nice job on this! Love the log stack trace feature too.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.