HTML Logging

Posted by Yergo on Sat 18 Dec 2010 10:50 PM — 7 posts, 25,668 views.

Poland #0
I have a little request.
Logs generated with html option are hudge and there are browser-killers. Why not to put in "standard preamble" a <style> part with all defined (ANSI and customs) colours, and than, during the log use <span id="ans1"></span> or <span id="cust12"></span> instead of those long old-html tags?
Australia Forum Administrator #1
Is it going to save a heap of space?

Currently a line in colour looks like this:


<font color="#C0C0C0">Original DikuMUD code by:</font>


So you want to change that to:


<span id="ans1">Original DikuMUD code by:</span>


Slightly shorter, sure. But hardly a huge reduction in size or complexity. And for stuff like ColourNote which can send arbitrary colours (and also MXP) we can't predict every possible colour, so some lines would have to fall back to using the existing method.
Amended on Sat 18 Dec 2010 11:17 PM by Nick Gammon
Poland #2
All standard colours may have their standard style in header. Not-configured colours from notes etc. may have something like current "font". And: what about this <table> code? Why not to use <pre> or <br /> tags instead of them?

Anyway <font> tag is not very on time during these days. Imo we/you should optimize the output to maybe not xhtml, but at least html 4.01.

My point is that when I'm playing (IF I'm playing) I'm in game around 7-10h a day. If there was some team fight actions during the day, opening such a table-based and style-less log in browser at my MSI Wind netbook can stun it for at least 5 minutes. Scrolling it is pain too. 2 years ago I switched to plain text logs thinking, that over that time something will be done with html logging. My fault I have not written earlier.

So, Is there any chance that the situation will change?

Edit: Look: http://eros.vlo.gda.pl/~bratex/arka/test.html
No table stuff. Apart of no-colour-stuff and impromer html ;P
Amended on Sun 19 Dec 2010 03:56 PM by Yergo
Australia Forum Administrator #3
I think what is slowing it down is the huge table - which it probably scans through to see how wide it gets. Try this.

Edit the logging configuration, and change the "File Preamble" from:


<html>
 <head>
 <title>Log of %N session</title>
 </head>
 <body>
   <table border=0 cellpadding=5 bgcolor="#000000">
   <tr><td>
   <pre><code>
    <font size=2 face="FixedSys, Lucida Console, Courier New, Courier">


to:



<html>

<style type="text/css">
  body {background-color: black;}
</style> 

 <head>
 <title>Log of %N session</title>
 </head>
 <body>
   <pre><code>
    <font size=2 face="FixedSys, Lucida Console, Courier New, Courier">



And change the File Postamble from:


</font></code></pre>
</td></tr></table>
</body>
</html>


to:


</font></code></pre>
</body>
</html>



Of course you can edit your existing logs and just fix up the first few, and last few, lines to be the same as what I suggested. Then they should load a lot faster.
Amended on Sun 19 Dec 2010 08:53 PM by Nick Gammon
Australia Forum Administrator #4
I've modified version 4.72 so that if you click on the "Standard HTML preamble/postamble" button in the logging configuration, it will put in the amended preamble that I suggested.
Poland #5
Table-less code helped. Still takes about 1 minute (but not 5) to load 5MB logfile into firefox , but smooth scrolling makes a huge difference.

Used preamble:
<html>
<head><title>Session of %P: %Y-%m-%d</title></head>
<style>
body{
	background-color: #000000;
	color: #696969;
	font-family: Courier New;
	font-size: 8pt;
	white-space: pre-wrap;
}
.time { color: #690000; }
</style>
<body>

So i can start every line with such a "timestamp":
<span class="time">[%X]</span> 


And this allows me to switch styles via onClick jscript action to set .time { display: none; } if Sb during reading dont like them.

Strange thing I have is that my input sometimes is logged twice (especially when the command prompt "> " is in line). I've tried to avoid this but then it sometimes don't log more than one command after prompt and those from sripts Send(). Im not sure if I'm clear :P
Amended on Tue 21 Dec 2010 04:39 PM by Yergo
Australia Forum Administrator #6
That looks pretty good. I should point out that for the web browser to read in, decode the HTML, and display 5 Mb in one minute is effectively decoding 1 Mb per 12 seconds (maybe 12,000 lines of text), which is pretty reasonable (in other words, 1,000 lines per second).

After all, web browers are designed to display web "pages" not web "tomes".

You could speed up looking at the logs by breaking them up (you can do this automatically with a timer) so a new log is started every hour or so.