How to log both text and html to separate files?

Posted by j0nas on Wed 02 Feb 2011 12:33 PM — 3 posts, 15,643 views.

#0
I'm looking for the holy grail of logging, one html-log with the color and stuff, and a second log with just the raw text, sans colors and everything. I understand that this isn't supported by the built-in stuff, but surely I can't be the only one who has ever wanted something like this. I did some searching here on the forum, but I couldn't find anything.

Has anyone else already written a plugin for this, or is there some other kind of trick that I can use to save myself some time?
Australia Forum Administrator #1
You might be able to do it with the OnPluginScreendraw plugin callback. This is passed the raw text of lines, along with a flag saying whether or not it is planned to be logged.

So you could do HTML logging in the usual way, and then write to a different file in your OnPluginScreendraw function if the "log" flag is set (for the non-coloured version).

http://www.gammon.com.au/scripts/doc.php?general=plugin_callbacks

However there was a problem reported recently with notes which are done in conjunction with "omit from output" where they might be drawn twice.

This wouldn't really apply to you if you just are logging input and output, not notes. Try it and see, it might save you a lot of work.
#2
I'm aware of the bug you're talking about, Nick, it's showing up in my logs as we speak, more or less. ;)

I was hoping that someone might already have written an plugin like this, but I guess not, perhaps I'll be the first. Thanks for the tips as how best to go about it!