[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  How to log both text and html to separate files?

How to log both text and html to separate files?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by j0nas   (56 posts)  [Biography] bio
Date Wed 02 Feb 2011 12:33 PM (UTC)
Message
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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 03 Feb 2011 12:44 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by j0nas   (56 posts)  [Biography] bio
Date Reply #2 on Mon 07 Feb 2011 12:39 AM (UTC)
Message
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!
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,541 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]