Logging in colour

Posted by Teclis on Thu 24 Jul 2003 12:38 PM — 4 posts, 18,800 views.

#0
No matter how many different ways i try to log an event in colour, there seems to be no hope unless i save it as a internet explorer file (.html) i think. I play on T2T, a MUD, and wish to beable to log sessions in colour. I can log a session to a .txt file, but then it is only in black and white, or i can log it as a html, which does not allow editing. Is there a way to log in ainsi color? I would be very grateful of any infomation that could help me conquer this problem. If no, then is there a way that i can send a log file to a log site, and have them accept, when they only accept txt files and ainsi files?
USA #1
If your problem is simply that you can't edit the HTML, you can solve that very easily by opening your HTML log file as if it were a text file. Of course, you'd need to understand basic HTML to make sense of parts of it, but it's certainly editable.
Australia Forum Administrator #2
There is a simple solution and a slightly more complex solution.

The simple solution is to simply turn on the "raw" log flag in the logging configuration. This simply logs everything that arrives from the MUD "as is". This may well work for you, as all the ANSI codes will still be there. However there are a few disadvantages of that method:

  • If the MUD is using MXP you will also log the MXP commands (eg. <room>blah</room>).
  • You will also log any incoming telnet negotiation sequences.
  • Any triggers you set up that omit from log will not have any effect.
  • Commands will not be logged.


The more complex solution is a plugin I just wrote. What this does is use a trigger and alias. The trigger has a low sequence number (5) so it will match all incoming text, and is set to match everything. It calls a script that reassembles the line using ANSI sequences, and writes that to the log file. It has the "keep evaluating" flag set so other triggers still match. It has "omit from log" set so you don't log each line twice.

The alias does a similar thing for commands you type, but is a bit simpler because it just logs the command in straight white on black (you could change that easily).

You can find this plugin (ANSI_Log) on the plugins page. Just download it and install it into any world you want to do ANSI logging for.


http://www.gammon.com.au/mushclient/plugins/


However there are a couple of issues you should be aware of:

  • If the MUD is sending MXP commands to change colours to non-standard colours (ones which don't have an ANSI equivalent) then they won't be logged in the correct colour - this is not a bug, it is simply because there is no ANSI equivalent for, say, "darksalmon" colour.
  • Commands are just logged in white on black - however you can edit the plugin and change it by adding a couple of extra lines.
  • The extra processing involved may slow the client down a bit, however I didn't notice much performance impact on my old 166 MHz Pentium, so this is probably not a big issue.
  • I haven't tested every combination (eg. inverse) so let me know if it doesn't work perfectly.

#3
Wow, thanks a lot Nick, i never realised how helpful the site actually is!!