Search FAQ

Gammon Forum

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 ➜ Jscript ➜ Daily Log

Daily Log

Posting of new messages is disabled at present.

Refresh page


Posted by Cage_fire_2000   USA  (119 posts)  Bio
Date Fri 10 Aug 2007 04:20 AM (UTC)
Message
I know, I know, this has been asked before, and I searched on the forums but didn't find much luck. My friend would like a way to reset his time-stamped logfile at midnight or so, and I thought this could be easily done with script and a timer, but when I checked it out the script functions require you to specify a filename for the log, but I want to use the %-substitutions in the world's log filename. Would it automatically swap these out if I just got it from alpha_options, or would I have to do the substitutions manually? It'd be nice if it did it automatically, or maybe if you specified a null string to OpenLog() it would use the preset logfilename making the substitutions. Any help clearing this up?
Top

Posted by Cage_fire_2000   USA  (119 posts)  Bio
Date Reply #1 on Fri 10 Aug 2007 04:51 AM (UTC)
Message
Never Mind, after about a half-hour of searching through the forums, I discovered that since 3.51 you were able to supply "" as a filename and use the filename in the options. Which is GREAT! Although maybe in the future it /might/ be nice to have a function to do the substitution so that plugins could use the same file format for making side-logs with FSO.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #2 on Fri 10 Aug 2007 05:06 AM (UTC)
Message
I have amended the documentation for OpenLog to make that clearer. If you are scripting log file opens you can always build up a filename yourself with things like the date in it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Cage_fire_2000   USA  (119 posts)  Bio
Date Reply #3 on Fri 10 Aug 2007 06:00 AM (UTC)
Message
OK, I think I just either found a bug or another reason to make that substitution function. While CloseLog does write the postamble to the file, OpenLog does not write the Preamble to the new file.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 10 Aug 2007 06:20 AM (UTC)
Message
Hmm, the documentation OpenLog for says "nor is a log-file preamble written", so OpenLog is behaving as documented.

The documentation for CloseLog does not say one way or another whether the postamble is written out, and you are right, it does write it - somewhat inconsistently. I have amended the documentation to make it clear that it does this.

I am reluctant to change either one, as people may well be relying on the current behaviour. You can always grab the world's log file preamble (GetInfo (11)) and write it. If it has substitution characters in it then you would need to do a find-and-replace to fix them up.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


16,480 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

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