[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Daily Log
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Daily Log

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Grimsbeard   (8 posts)  [Biography] 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
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] 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.
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] 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?
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] 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

[Go to top] top

Posted by Nick Gammon   Australia  (21,608 posts)  [Biography] 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
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] 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.
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,608 posts)  [Biography] 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>


Template:pasting 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
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] 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")).
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,608 posts)  [Biography] 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
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] bio
Date Reply #11 on Mon 07 Sep 2009 02:44 PM (UTC)
Message
Yup
[Go to top] top

Posted by Nick Gammon   Australia  (21,608 posts)  [Biography] 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
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] 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.
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] bio
Date Reply #14 on Tue 08 Sep 2009 01:26 PM (UTC)
Message
That worked Nick. Thanks.

Remember ....... Timers, not triggers people. *siiigh*
[Go to top] 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.


13,236 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]