TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

html #logging - 1.93 v 1.95

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
lazloth



Joined: 05 Dec 2004
Posts: 6

PostPosted: Sun Feb 12, 2006 11:03 am    Post subject: html #logging - 1.93 v 1.95 Reply with quote

Another difference I've found since updating to 1.95 is tied to logging:
In 1.93, my [html] logs were prepended with an html header like
Code:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Generated by TinTin++ 1.93 - http://www.scandum.com/tintin">
<style type="text/css">
{
        font-family: Courier;
        font-size: 10pt;
}
.d30{ color: #000; } .l30{ color: #555; } .b40{ background-color: #000; }
.d31{ color: #B00; } .l31{ color: #F55; } .b41{ background-color: #B00; }
.d32{ color: #0B0; } .l32{ color: #5F5; } .b42{ background-color: #0B0; }
.d33{ color: #BB0; } .l33{ color: #FF5; } .b43{ background-color: #BB0; }
.d34{ color: #00B; } .l34{ color: #55F; } .b44{ background-color: #00B; }
.d35{ color: #B0B; } .l35{ color: #F5F; } .b45{ background-color: #B0B; }
.d36{ color: #0BB; } .l36{ color: #5FF; } .b46{ background-color: #0BB; }
.d37{ color: #BBB; } .l37{ color: #FFF; } .b47{ background-color: #BBB; }
.d38{ color: #FFF; } .l38{ color: #FFF; } .b48{ background-color: #000; }
.d39{ color: #FFF; } .l39{ color: #FFF; } .b49{ background-color: #000; }
</STYLE>
<body bgcolor="#000000">
</head>


In 1.95 they're not.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sun Feb 12, 2006 2:10 pm    Post subject: Reply with quote

As far as I can see it adds headers in 1.95

A possible cause might be when using #log append which doesn't generate a header if the file is empty. I added better support for that to my todo list. Otherwise I have no idea what is causing this, unless you start logging before setting #config log to html.
Back to top
View user's profile Send private message Send e-mail
lazloth



Joined: 05 Dec 2004
Posts: 6

PostPosted: Sun Feb 12, 2006 3:11 pm    Post subject: Reply with quote

It's the #log append mode, yeah. No header is added to an empty file -- is that by design? #log overwrite generates the html tags as expected.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Sun Feb 12, 2006 8:32 pm    Post subject: Reply with quote

I looked at my code, and it only generates a header if the file is empty.

Code:

tintin_printf(ses, "#OK: LOGGING OUTPUT TO '%s' FILESIZE: %ld", right, ftell(ses->logfile));

if (ftell(ses->logfile) == 0 && HAS_BIT(ses->flags, SES_FLAG_LOGHTML))
{
     write_html_header(ses->logfile);
}


What message for filesize are you getting?
Back to top
View user's profile Send private message Send e-mail
lazloth



Joined: 05 Dec 2004
Posts: 6

PostPosted: Sun Feb 12, 2006 8:42 pm    Post subject: Reply with quote

I know Wink I looked over log.c and without really debugging, cursory glance seems like it should work.

LOG
#FORMAT: $time IS NOW SET TO {1139794751}
#FORMAT: $logfile IS NOW SET TO {./log/bken/12-02-2006.html}
#OK: LOGGING OUTPUT TO './log/bken/12-02-2006.html' FILESIZE: 0
l
You are gone, remember?

129/129h 127/127t 147/155v:mirukkim:walking> #LOG
#OK: LOGGING TURNED OFF.

---

[~/tintin++/log/bken]: cat 12-02-2006.html
#OK: LOGGING OUTPUT TO './log/bken/12-02-2006.html' FILESIZE: 0
l
</span><span class="d31">You are gone, remember?</span><span class="d39">

129/129h 127/127t 147/155v:mirukkim:walking&gt; #LOG
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Tue Feb 14, 2006 9:43 am    Post subject: Reply with quote

Found the bug, the OK message reporting the file size is logged to file, causing the file to no longer be 0 when writing the header.

So either removing the message or moving it down should fix the bug. I moved it down for the next version.

Code:

     if ((ses->logfile = fopen(right, "a")))
     {
          if (ftell(ses->logfile) == 0 && HAS_BIT(ses->flags, SES_FLAG_LOGHTML))
          {
               write_html_header(ses->logfile);
          }
          tintin_printf(ses, "#OK: LOGGING OUTPUT TO '%s' FILESIZE: %ld", right, ftell(ses->logfile));
     }
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group