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
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Oct 31, 2008 4:24 pm   

Automatic Logging?
 
I thought CMUD ha automatic logging but couldn't find it in the general options. I think it would be neat if we could set up automatic logging for different sessions that went to different sections and gave a generic name to each log that went up in increments each time a new one was added. The logs would work following all the rules for a normal logs.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 31, 2008 5:10 pm   
 
You can, just stick an OnConnect event in each session's untitled window that runs the #log command. I personally don't do this because my IP and things will appear in the log - instead I trigger off a message I receive every time I log in, shortly after all that sensitive information - I'm sure you know the type of thing I mean.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Oct 31, 2008 5:16 pm   
 
I can arrange #log to work in a way that increments and such? I knew there was a #log command and had considered it, but I wasn't sure if it could take arguments (Should have looked it up). It might still be an interesting idea for those people who like a visual interface and such, but I'll look at the log command.

Edit:
Some questions

if I do

#LOG C:\Documents and Settings\bleas\My Documents\DSL\logtest.txt new

Will it make a new log in that location? Also, what if I put new and it encounters a file of the same name, does it increment with (1) or something?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 31, 2008 6:19 pm   
 
Yes, it'll create a new file. I don't know what it'll do if there's already a file, probably overwrite. Try it and see. You don't need to use the new option to force it to create a new file though, it'll do that automatically if you don't use the new option. If there's already a file with that name, it'll append.

Btw, you might find the %time function useful to return the current date, so you can include that in the name of the log. Nobody likes a 30mb .txt file, least of all notepad.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Oct 31, 2008 6:25 pm   
 
Fang Xianfu wrote:
Yes, it'll create a new file. I don't know what it'll do if there's already a file, probably overwrite. Try it and see. You don't need to use the new option to force it to create a new file though, it'll do that automatically if you don't use the new option. If there's already a file with that name, it'll append.

Btw, you might find the %time function useful to return the current date, so you can include that in the name of the log. Nobody likes a 30mb .txt file, least of all notepad.


I would like that, I'd really rather not have it overwrite and I would like to have the logs create new instances every time. So I can do it like...


#LOG C:\Documents and Settings\bleas\My Documents\DSL\"Yasan"%time".txt"

??
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
hogarius
Adept


Joined: 29 Jan 2003
Posts: 221
Location: islands.genesismuds.org

PostPosted: Fri Oct 31, 2008 8:06 pm   
 
Chamenas, if someone doesn't beat me to it, sometime this weekend I can post the string I use to create a new log file for each session I play on Modus Operandi, showing the date and time that I log in. I'm at work right now, so I don't have the info right at hand.

I think I actually have this set up as part of either the Autolog entry or an OnConnect event. As a result, the log includes the login dialog as well, which Fang has mentioned several times he prefers not to include, but it should give you a good example you can adapt for your own purposes.
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Oct 31, 2008 8:41 pm   
 
#ALIAS atConnect {#LOG %concat("C:\Documents and Settings\bleas\My Documents\DSL\Yasan", %time("aaa mmmm d hh:mm"),".txt"}

Though I recall that when I made mine I had some problems with it at first... and this is off the top of my head.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 31, 2008 9:40 pm   
 
I use

#log %concat("D:\My Documents\Mud Logs\Imperian\Imperian-",%time(yyyy-mm-dd),".txt")

I put the date backwards so when they're sorted alphabetically, they're in date order. Also, I have a calendar alias that updates a data record variable with keys as dates and values as descriptive strings that I use to remind myself when important things happened. It can be annoying finding stuff otherwise, since everything - including your epic 2hr bashing session - is logged.

Also, ralgith's example needs changing to #event OnConnect, but it's the same idea.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Oct 31, 2008 9:58 pm   
 
Also, why not use gaglog to ignore the all of the log in chatter?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 31, 2008 10:18 pm   
 
Because gaglog didn't exist back in my day, sonny, and I'm damned if I'm going to start now!

And also because I don't know at the time what I'm going to want to look back on and what I won't. If something's especially important - like, say, someone's wedding - then I'll make a separate log, but otherwise having everything means I've always got what I'm after.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Oct 31, 2008 10:21 pm   
 
Fang Xianfu wrote:
Because gaglog didn't exist back in my day, sonny, and I'm damned if I'm going to start now!

And also because I don't know at the time what I'm going to want to look back on and what I won't. If something's especially important - like, say, someone's wedding - then I'll make a separate log, but otherwise having everything means I've always got what I'm after.


Razz

Though my problems with gaglog make me sad Sad
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Nov 02, 2008 12:11 am   
 
#log %concat("C:\My Documents\DSL\Tauredae\Logs\Tauredae -",%time(yyyy-mm-dd),".txt")


That should start a log right? I get this message:

Log is on: C:\My Documents\DSL\Tauredae\Logs\Tauredae -2008-11-01.txt


But it doesn't create anything

Edit: Nevermind, I fixed it.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Nov 02, 2008 12:15 am   
 
I expect it doesn't create new folders, make sure all of those exist. If that's the problem, though, it should really be giving an error message rather than continuing as if all is well. I'll do some checking.

EDIT: Yes, it's not creating folders and also not giving an error. I'll post about that in a second.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Nov 02, 2008 12:17 am   
 
I had the wrong path, it wanted me to create it all the way from the actual path as opposed to the My Documents shortcut
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Sun Nov 02, 2008 12:19 am   
 
That is the correct message you should be seeing. Try getting rid of that space between the Tauredae and the hyphen.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sun Nov 02, 2008 12:19 am   
 
I got rid of the space and put in the correct path, as per my edit above, I figured it out Razz
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Sun Nov 02, 2008 12:21 am   
 
Typoes: Every coder's worst enemy.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
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