Thread: 2.7 Update
View Single Post
01/07/17, 05:25 AM   #22
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Or maybe add a set of logging function that write directly to the interface log without impacting the game's performance too much.
LogError, LogWarning, LogInfo, LogDebug + SetLogLevel which defaults to LOG_LEVEL_WARNING on live and LOG_LEVEL_DEBUG on pts.

The log functions could also write which addon called them, at which time, and from which line e.g:
Code:
2017-01-07 12:23:45:678 [ingame] something, ingame/something/somefile.lua:123
2017-01-07 12:23:46:042 [AwesomeGuildStore] another, AwesomeGuildStore/StartUp.lua:42
Maybe also add a function SetLogStack(level, boolean[, addonName]) which allows for requesting the stacktrace to be printed after every message and an optional boolean on the log methods themselves for triggering it for individual messages.

The alias functions could then all include a LogInfo("deprecated method, consider replacing it").

This could help a lot with debugging addons and also during development where putting a d() call into a loop can cause a client crash.

Last edited by sirinsidiator : 01/07/17 at 05:27 AM.
  Reply With Quote