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
littlebluefish
Newbie


Joined: 26 Jan 2007
Posts: 2

PostPosted: Fri Jan 26, 2007 9:14 pm   

Logging by Char name and Date?
 
I had a trigger to log by char name and then by date, but have lost it in some bugges. Does anyone know how to do this in Cmud?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jan 27, 2007 6:48 am   
 
#log MyMudname-%char-%time(yyyy-mm-dd).txt

Will save to the format MyMudname-Fang-2007-01-22.txt and will automatically append if a log with that name already exists. Only thing it won't do is auto-update the name when the date changes, so you could have this:

#alarm 00:00:01 {#log MyMudname-%char-%time(yyyy-mm-dd).txt}

to change it automatically.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
littlebluefish
Newbie


Joined: 26 Jan 2007
Posts: 2

PostPosted: Sat Jan 27, 2007 7:01 am   
 
That works nicely! Thankyou :)
Reply with quote
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: Sat Feb 03, 2007 10:24 am   
 
Fang Xianfu wrote:
Only thing it won't do is auto-update the name when the date changes
Huh? Do you eman that it wont open new log after midnight or what do you mean?
Because i use
#log %time(yyyy-mm-dd) %char.txt
and it works nicely as i dont want no slipping of my logs when i play late.
_________________
BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Feb 03, 2007 3:09 pm   
 
Yes, I mean that when it gets to midnight the log won't automatically change date unless you use the alarm I provided as well.
_________________
Rorso's syntax colouriser.

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


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Apr 19, 2007 1:53 pm   
 
This isn't working for me. The log disappears into thin air. It shows that it is logging but then when I close out CMUD the log is nowhere to be found.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Apr 19, 2007 3:10 pm   
 
The log is created in whatever CMUD considers your current working directory. This is typically where CMUD was installed. However if you changed direction using commands (and I believe when using Browse File dialog for packages etc) this changes the working directory as well.

If you still can not find it, check to make sure you don't have any permissions issues in writing out your log file.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Apr 19, 2007 3:29 pm   
 
You can also define the path explicitly:

#log "D:\My Documents\logs\log.log"

Windows search function is good for finding lost files when you didn't tell them explicitly where to go, too.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Apr 19, 2007 3:47 pm   
 
Fang Xianfu wrote:
You can also define the path explicitly:

#log "D:\My Documents\logs\log.log"

Windows search function is good for finding lost files when you didn't tell them explicitly where to go, too.



Obviously I ran search before even posting. Why is it saying that it is logging and then the file doesn't exist? I'm kind of pissed off about it.


Edit:

Well apparently even though it says it was logging it wasn't. I went offline and tested trying to create logs.

#log Name_%time(m/dd/yy).txt does not work at all.

#log Name.txt works and creates a log file.

#log "C:\My Documents\My Games\Name.txt" also works.

So how can I possible autolog using onConnect and create a log for each date? You can't use %time() or if there is a way it isn't working for me.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Apr 19, 2007 5:04 pm   
 
I just took a second look and the problem is the '/' in the file name. Windows does allow such a character in the file names. So CMUD issues the commands and thinks it was successful, but Windows does not allow it. So in that respect there's a bug there.

If you want simply change you pattern to something else like this #log Name_%time(m-dd-yy).txt
_________________
Asati di tempari!
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Apr 19, 2007 5:46 pm   
 
Tech wrote:
I just took a second look and the problem is the '/' in the file name. Windows does allow such a character in the file names. So CMUD issues the commands and thinks it was successful, but Windows does not allow it. So in that respect there's a bug there.

If you want simply change you pattern to something else like this #log Name_%time(m-dd-yy).txt


Finally! An answer that helped!

Thanks. That actually works!
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