Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ HTML Logging

HTML Logging

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


Posted by Yergo   Poland  (20 posts)  Bio
Date Sat 18 Dec 2010 10:50 PM (UTC)
Message
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?

I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 18 Dec 2010 11:16 PM (UTC)

Amended on Sat 18 Dec 2010 11:17 PM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Yergo   Poland  (20 posts)  Bio
Date Reply #2 on Sun 19 Dec 2010 11:01 AM (UTC)

Amended on Sun 19 Dec 2010 03:56 PM (UTC) by Yergo

Message
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

I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 19 Dec 2010 08:52 PM (UTC)

Amended on Sun 19 Dec 2010 08:53 PM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 19 Dec 2010 09:24 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Yergo   Poland  (20 posts)  Bio
Date Reply #5 on Tue 21 Dec 2010 04:38 PM (UTC)

Amended on Tue 21 Dec 2010 04:39 PM (UTC) by Yergo

Message
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

I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 22 Dec 2010 11:00 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


19,568 views.

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

Go to topic:           Search the forum


[Go to top] top

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