Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Daily Log
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Sat 05 Sep 2009 09:14 AM (UTC) |
Message
| I have seen a couple of really old forums about it but I simply cannot make heads or tails.
What I want to do is have folders per world.... and in that folder a new log file is started every day at 00:00:01 under the X Day of Y Month in Z Year.
How? :D
ps. Been using MUSHclient since it was waaaay old. Thanks :D | Top |
|
Posted by
| Blainer
(191 posts) Bio
|
Date
| Reply #1 on Sun 06 Sep 2009 01:42 AM (UTC) |
Message
| My understanding of the log system is that you configure the world file to log to a file that can contain the current date and time etc. When the world connects every thing will be logged to this file. I'm not sure about MUSH creating a new file at midnight, I'm pretty sure it's per session. So I think this would require a simple script to start and stop logging when the date changes. | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #2 on Sun 06 Sep 2009 01:51 AM (UTC) |
Message
| Pretend I am a retard when it comes to code and scripting.... trust me, I am not far from it.
Someone got something on their client to suitably match the need? | Top |
|
Posted by
| Blainer
(191 posts) Bio
|
Date
| Reply #3 on Sun 06 Sep 2009 04:04 AM (UTC) |
Message
| I have Game -> Configure -> Logging configured to log to this file:
C:\Program Files\MUSHclient\logs\%d.%b.%y_Command_Window.html
This creates a file with the name:
C:\Program Files\MUSHclient\logs\31.Aug.09_Command_Window.html
So each time MUSH is started the log is appended of or a new one created with current date and time.
For my chat window I have to manually select Log Session from the file menu each time I start MUSH, I think this is because MUSH starts logging on world connect.
I don't think the you really need to script this MUSH will write the log file with the date for each day.
Here is a picture of my log dialog:
http://picasaweb.google.com/lh/photo/bgGiB_1L2wLiruQ2ZaX8uA?feat=directlink
| Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #4 on Sun 06 Sep 2009 08:25 AM (UTC) |
Message
| There are other things you can put in the log file name, such as the world name. See:
http://www.gammon.com.au/scripts/doc.php?dialog=IDD_PREFS_P4
You could make each world have its own subdirectory, however it won't create the subdirectory for you. You would have to manually make a subdirectory per world, and then the logs for that world could go in it. eg.
C:\Program Files\MUSHclient\logs\%N\%d.%b.%y_world_log.txt
The %N would be expanded to the current world name.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #5 on Sun 06 Sep 2009 01:05 PM (UTC) |
Message
| Thanks guys and thanks Nick, you have always answered every question I ever had... (usually vis-a-vis email back in the day under a different email lol).
Thanks a bunch. | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #6 on Sun 06 Sep 2009 01:19 PM (UTC) |
Message
| Oh and that string you suggested, Nick, this would need me to manually reconnect, yes? I have a staff bit on one MUSH and well, I never disconnect with him :P | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #7 on Sun 06 Sep 2009 09:16 PM (UTC) |
Message
| What you can do is add a timer like this:
<timers>
<timer
name="Reopen_Log"
enabled="y"
hour="1"
send_to="12"
>
<send>
CloseLog ()
OpenLog ("", true)
</send>
</timer>
</timers>
|
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
That will close and re-open the log every hour (if you are connected). Thus, it will tick over at midnight (or sometime in the next hour afterwards), closing the current log file and opening a new one. It will use the current log file string if you supply an empty string to OpenLog, and thus it will respect the date/time codes in it. During the day it will append to the existing log file, so you won't get lots of different files in one day. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Fadedparadox
USA (91 posts) Bio
|
Date
| Reply #8 on Mon 07 Sep 2009 02:42 AM (UTC) Amended on Mon 07 Sep 2009 02:43 AM (UTC) by Fadedparadox
|
Message
| In case this helps anyone, this is what I use to log unique files every time.
logging = function (mode)
if (mode == "on") then
local logname = GetInfo (66) .. [[logs\Trevize ]] .. os.date("%d-%m-%y ")
.. string.format ("%08i",math.random (1, 99999999)) .. ".html"
OpenLog (logname)
WriteLog ("<html>")
WriteLog ("<head>")
WriteLog ("<title>MUSHclient Log - Trevize Moonflair</title>")
WriteLog ("</head>")
WriteLog ("<body>")
WriteLog ('<table border=0 cellpadding=5 bgcolor="#000000">')
WriteLog ("<tr><td>")
WriteLog ('<pre><code><font size=2 face="FixedSys, Lucida Console, Courier New, Courier">')
Note ("Logging to " .. logname)
else
if IsLogOpen() then
Note ("Stopped logging")
WriteLog ("</font></code></pre>")
WriteLog ("</td></tr></table>")
WriteLog ("</body>")
WriteLog ("</html>")
CloseLog ()
end -- if
end -- if
end -- func
I just have a ^log (on|off)$ alias that calls logging (string.lower("%1")). | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #9 on Mon 07 Sep 2009 06:56 AM (UTC) |
Message
| Nick, I get:
Line 1: Tag not used: <timers> ()
When I try and use the timer script. | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #10 on Mon 07 Sep 2009 11:18 AM (UTC) |
Message
| Did you paste it into the Timers configuration? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #12 on Mon 07 Sep 2009 09:08 PM (UTC) |
Message
| It worked for me when I pasted it into the Timers configuration. The instructions in the "how to paste" page are for triggers not timers. If you follow those literally you will see the message:
Line 1: Tag not used: <timers> ()
You need to switch to the Timers part of world configuration, not the Triggers part. The instructions given showed triggers as an example. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #13 on Mon 07 Sep 2009 11:06 PM (UTC) |
Message
| *sighs* Yup. I am a bonehead.
I'll post again when it hits midnight in Canuckistan and tell you if it works... hah. | Top |
|
Posted by
| Grimsbeard
(8 posts) Bio
|
Date
| Reply #14 on Tue 08 Sep 2009 01:26 PM (UTC) |
Message
| That worked Nick. Thanks.
Remember ....... Timers, not triggers people. *siiigh* | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
55,617 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top