Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Asilient_1
Apprentice


Joined: 26 Apr 2007
Posts: 113

PostPosted: Sun Feb 24, 2008 8:02 pm   

Logging ansi in HTML [2.18]
 
Hey, guys,

I've always had habit of logging in ansi since I've used Zmud and converted via Charbal's. However, in the more recent Cmud I've been having an error each time I try converting "Error 13 occured while converting logfile: Type mismatch." I've also tried using logedit, but have stray ansi tags littered throughout the converted log.

So my question is: Were any changes made to the ansi tags logged in Cmud? And if so has anyone else come across these problems/fixed them?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Feb 24, 2008 8:15 pm   
 
Zugg did indeed make some changes in how ansi codes are expressed in cmud recently.
I believe it had to do with the implementation of the new styles system. So you might look back into posts from that time period in the beta forum.

As to the stray tags being left around those would be some of the special tags that Zugg added for the styles to work correctly.
As far as I know no one has updated Charbals converter or created a new one.

I suggested opening the log via the #read command and loading a large buffer of the log into a variable then using #show on the variable. I would advise creating a separate session without any triggers for this log reading package.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Mar 05, 2008 2:07 am   
 
The problem with creating a converter to convert the ANSI and Style info to HTML is.
The only style info that CMUD saves is
ESC[0S = Default session text , This includes any MXP or any Non-ANSI colours, in effect all MXP or custom colour info is lost
ESC[1S = Information messages
ESC[2S = Command echo
ESC[3S = Timestamp
Those four Escape sequences are it, no xtra info embedded anywhere else.
Now I can make a Python script to convert logs with those ESCAPES to an html colour and font representation but if you use MXP or #COL to change the colour/font then all that info would be lost.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Mar 06, 2008 7:21 pm   
 
This kind of sucks. I use all MXP instead of ANSI because I would rather have decent color options. I think LogEdit will convert them without an error, but like Dharkael said, you lose all MXP and custom color information.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Mar 06, 2008 11:28 pm   
 
Logging of MXP-tagged colour (which I'm guessing would involve full, native HTML log support) is on the wishlist. I also can't wait :)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Mar 07, 2008 12:12 am   
 
I dont see why Fang.
Why not use the escape sequence to actually encode the colour data
ESC[XXXXXX;XXXXXXZ or something Similar where XX are hexadecimal characters imparting the required info.
Then it would be childs play to write a converter to that understands that ESC sequence and convert CMUD's Logs to HTML
Tide us over until Zugg is ready to support HTML log natively.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Mar 07, 2008 1:37 am   
 
You don't see why what? The only things I said were that MXP tag logging is on the wishlist, which is true; that I can't wait, which is my feeling; and that it would probably involve CMUD supporting HTML logging, which you seem to agree with.

The issue, I would imagine, is having CMUD know what colour to write where - I expect that the logging only understands the standard ANSI colour palette, just like when you paste text into an ANSI trigger (you'll notice that the escape codes in an ANSI log are the same "reformed" ANSI codes you get in ANSI triggers). If you're going to add code and convert any colour to some made-up escape sequence, you might as well just have that code add a HTML header to the file and print the <color> tags directly. In fact, that'd probably be a simpler solution since MXP tags can be nested and escape sequences can't.

If I'm correct in my assumption, and escape codes would be no easier, it makes much more sense to use a universally-accepted standard than to make up your own. But you seem to accept all these things when you say "until ... [CMUD] supports HTML logging", so what was your issue?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Mar 07, 2008 2:00 am   
 
I suppose what I should have said is "I dont see why logging of MXP-tagged colour, would involve full, native HTML log support" and then continued with the rest of my previous statements.
Specifically I wished to express that I did not see the need to wait for native HTML when simply supplying the colour info in an escape sequence would be so easily done.
I fail to see how the addition of a custom ANSI sequence would be of the same level of difficulty as implementing a whole and complete alternative logging system.
As for universally-accepted standards I haven't found any standards which include CMUD's current use of ESC[0S, ESC[1S and so forth, yet CMUD already emits these in its current
ANSI Logs.
Zugg has already added extra sequences and I was suggesting he add another set of sequences which gave the missing colour info.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Mar 07, 2008 5:57 pm   
 
The fact that CMUD is adding the ESC[0S sequences to the log file is a bug. These sequences were only supposed to be used internally to support CMUD Styles. They will be removed from the external log file in a future version. And yes, HTML logging is planned. You can almost do it now. Load the ANSI log into the Editor window and then use the File/SaveAs dialog to save the window contents as HTML. Or, turn on the MXP Capture option in v2.18 and capture full MXP/ANSI text to the editor, and then use the editor File/SaveAs dialog to save as HTML.
Reply with quote
darkspot
Apprentice


Joined: 29 Jul 2002
Posts: 105

PostPosted: Fri Mar 14, 2008 8:56 pm   
 
How do you do the MXP Capture option? How long before capturing to HTML will be enabled? I love the idea, I've always loved seeing things in the color I get them and hate the process of having to convert things, it usually prevents me from actually logging ansi colors.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri Mar 14, 2008 9:01 pm   
 
I tried Zugg's method. It didn't work. It just comes out exactly like the log looks in text. I'm turning off logging ansi and capturing MXP for now, because it is just about impossible to read the log.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu May 01, 2008 2:34 am   
 
Btw, the ESC[0S bug is fixed for v2.23.

Also, you might be somewhat happy to hear that v2.23 also has basic implementation of HTML logging. It converts ANSI color to HTML color and also handles the new Style system. It will also convert MXP COLOR tags into proper HTML styles. However, any other MXP is directly copied to the log file, and since MXP is not fully HTML compatible, this might cause issues on MXP MUDs.

The handling of MXP logging to proper HTML will be improved in some future version, but I thought it was useful just to get it basically working with color to start. In HTML logging mode, CMUD will also add a BR to the end of each line automatically. But CMUD does *not* set the overall default foreground and background colors (because it doesn't generate any BODY tag)...you have to add that yourself in whatever HTML file you include the log data.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu May 01, 2008 3:38 am   
 
This is awesome! Thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net