Redirecting trace output?

Posted by Mudguy on Wed 03 Aug 2005 02:37 AM — 3 posts, 13,536 views.

#0
Due to a variety of reasons (spam, infinite loops with OnPluginPartialLine, etc), I am unable to use trace in situations where my triggers, aliases and scripts are under real pressure, and actually break. And the idea struck me: specifying a function other than world.Note for the trace data to be sent to. Ie, in Python:

debug_log = file('C:/Program Files/MUSHclient/logs/debug_log.txt', 'w')

world.TraceDestination = debug_log.write
world.Trace = True



Altarnatively, if for whatever reason this is impractical, an OnPluginTrigger/AliasMatch for debugging would be a great boon, and vastly preferable to putting an equivalent bit of code in all my triggers and aliases.
Australia Forum Administrator #1
That's quite a nice idea. I'll look at making a trace callback, which if present will override the default of writing to the output window. Then you can output to screen, filter, write to disk, notepad window, or whatever.
Australia Forum Administrator #2
Added to version 3.67. There is now a plugin callback OnPluginTrace.

In there you can choose to write to a file, append to notepad, or take other actions (like, conditionally write to a file).