Logging: postamble putting text on start of the line

Posted by Scypio on Mon 18 Jul 2005 11:05 PM — 7 posts, 25,906 views.

Poland #0
So, the problem is as stated in the topic - I put some text in the postamble of the output lines (in logging preferences) - namely:
<font color="#000000">&lt!RL!%H:%M:%S:0&gt</font>

The font color is just to make it invisible for the reader, it's supposed to help with some real-time-log-reading application that my friend is developing.
However, the log produced has those time tags at start of the line, not at the end where I expected them to be. I played a bit and put the tags in preamble and got exactly the same result.
Australia Forum Administrator #1
I can't reproduce this. I put text in the postamble and it appears at the end of the line. What version of MUSHclient are you using?
Poland #2
Noticed it on 3.66. But on the other computer, on 3.65, it seems the same.
Poland #3
I uploaded a screenshot of my logging settings:
http://show.imagehosting.us/showimg.php?file=nouser_477/T0_-1_477919.jpg&picid=477919&uid=0

The log of:

g
A cozy tent(s and n)
 An empty bottle [6]
 A wooden ballot box [1 vote]
 The board of Gondor's Vengeance [25 notes]
south
west
By a small campfire(se, s, sw, w, n and e)
 A piece of jerky
 A jute bag
 A flag
 An empty keg
 An empty bottle [4]
HP:230 EP:230 -  >


looks like this:

<!RL!06:45:26:0>g
A cozy tent(s and n)
<!RL!06:45:29:0> An empty bottle [6]
<!RL!06:45:29:0> A wooden ballot box [1 vote]
<!RL!06:45:29:0> The board of Gondor's Vengeance [25 notes]
<!RL!06:45:29:0>south
west
By a small campfire(se, s, sw, w, n and e)
<!RL!06:45:29:0> A piece of jerky
<!RL!06:45:29:0> A jute bag
<!RL!06:45:29:0> A flag
<!RL!06:45:29:0> An empty keg
<!RL!06:45:29:0> An empty bottle [4]
<!RL!06:45:29:0>HP:230 EP:230 -  >
Australia Forum Administrator #4
OK, this is HTML logging. What I think is happening is that the conversion that fixes up text from "straight" text into HTML (eg. > becomes &gt; ) is also converting the newline into <BR>.

So, what you are getting is:



(preamble) (line converted) <br> (postamble) (newline character)


When you view this in HTML it looks like the postamble is on a new line.

A couple of workarounds:

  • Put the time at the start of the line
  • Make a trigger to match every line and log them yourself with some scripting, to get it the exact way you want.


Poland #5
Ok, so I made this plugin for this, just wondering whether I didn't forget anything, so if you feel like wasting 5 mins of your life you could take a look at that and tell me if it's ok (including just the script not full plugin for obvious reasons).


function RealLog(tname, output, wilds)
{	
var LineNumber=GetLinesInBufferCount();
var LineText="";
var StyleText="";
var style=0;
var styles=0;
styles=GetLineInfo (LineNumber, 11);
for (style = 1; style<=styles; style++)
{
StyleText = '<font color="' + RGBColourToName(GetStyleInfo (LineNumber, style, 14)) + '">';
StyleText += GetStyleInfo (LineNumber, style, 1)
if (GetStyleInfo (LineNumber, style, 9))
{
StyleText = "<u>" + StyleText + "</u>"
}
LineText += StyleText;
}
var d, RL='<font color="#000000">&lt!RL!';
var c = ":";
d=new Date();
RL += d.getHours() + c;
RL += d.getMinutes() + c;
RL += d.getSeconds() + c;
RL += d.getMilliseconds();
RL += "&gt";
WriteLog (LineText + " " + RL);
}
#6
heh. I can see instead GV GH!