|
littlebluefish Newbie
Joined: 26 Jan 2007 Posts: 2
|
Posted: 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?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
littlebluefish Newbie
Joined: 26 Jan 2007 Posts: 2
|
Posted: Sat Jan 27, 2007 7:01 am |
That works nicely! Thankyou :)
|
|
|
|
BlackSmith Apprentice
Joined: 08 Dec 2002 Posts: 152
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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! |
|
|
|
|
|