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

Gammon Software Solutions 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?
(New message)
Subject: Daily Log
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Henry Tanner   Finland  (23 posts)  [Biography] bio
Date Fri 25 Sep 2009 07:08 PM (UTC)  quote  ]
Message
I checked out Fadedparadox's timer and there it was, the answer right infront of my eyes! I guess I need to stop to be affraid of difficult looking scripts :)

I got this!
[Go to top] top

Posted by Henry Tanner   Finland  (23 posts)  [Biography] bio
Date Fri 25 Sep 2009 07:49 AM (UTC)  quote  ]
Message
Okay, here's another one.

I figured out (thanks to this post) how to automate my log dividing into smaller parts (through the timetags in the filename), but still I manage to get files as big as 4megs or so (which is way too big).

So I made a timer that simply does a CloseLog and an OpenLog. It works fine, but it doesn't throw in the HTML start and end tags (i'm logging in .html).

My question is, how can I get those tags into the log?

I got this!
[Go to top] top

Posted by Henry Tanner   Finland  (23 posts)  [Biography] bio
Date Tue 22 Sep 2009 04:06 PM (UTC)  quote  ]
Message
Awesome, I didn't realise that it'd be as simple as setting tags to the filename! Magnificent!

I got this!
[Go to top] top

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

Remember ....... Timers, not triggers people. *siiigh*
[Go to top] top

Posted by Grimsbeard   (8 posts)  [Biography] bio
Date Mon 07 Sep 2009 11:06 PM (UTC)  quote  ]
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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 07 Sep 2009 09:08 PM (UTC)  quote  ]
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 Mon 07 Sep 2009 02:44 PM (UTC)  quote  ]
Message
Yup
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 07 Sep 2009 11:18 AM (UTC)  quote  ]
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 Mon 07 Sep 2009 06:56 AM (UTC)  quote  ]
Message
Nick, I get:

Line 1: Tag not used: <timers> ()

When I try and use the timer script.
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] bio
Date Mon 07 Sep 2009 02:42 AM (UTC)  quote  ]

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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Sep 2009 09:16 PM (UTC)  quote  ]
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 Grimsbeard   (8 posts)  [Biography] bio
Date Sun 06 Sep 2009 01:19 PM (UTC)  quote  ]
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 Grimsbeard   (8 posts)  [Biography] bio
Date Sun 06 Sep 2009 01:05 PM (UTC)  quote  ]
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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 06 Sep 2009 08:25 AM (UTC)  quote  ]
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 Blainer   (191 posts)  [Biography] bio
Date Sun 06 Sep 2009 04:04 AM (UTC)  quote  ]
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

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.


5,464 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]