Made a quick edit just to test in BugEater. It worked with several addons, though not Zolan's Anchors Away. Zolan does a
. If it loads before BugEater/whatever addon, then it can't be blocked in this method.
First -- have a variable that indicates ignore output for first 2 seconds.
(Could probably tune it down)
Lua Code:
BugEater.initIgnore = true
zo_callLater(function() BugEater.initIgnore = false end, 2000)
Now in BugEater, thelegendaryof overwrites the d() function, which lets him parse out, buffer, and save messages. Adding this to the new d() function allows ignoring:
Lua Code:
-- function d(...)
d = function(...)
if BugEater.initIgnore then do return end end
-- rest of code (needed so it'll actually call after 2sec
end
For a standalone, you could probably do something like:
Lua Code:
local d_old = d
d = function(...) end
zo_callLater(function() d = d_old end, 2000)
This replaces the global debug function with a no-op for the first 2 seconds after load/reloadUI. The actual chat messages go through different handlers, so it won't kill those.
(Of course, this would render some of BugEater's functionality invalid, so should probably add an OptionalDependsOn in order to play nice with that addon.)