Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 18, 2013, 12:02:52 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Make log file name the same as Script name  (Read 1191 times)
woodfold
JkDefrag Senior
****
Posts: 31


View Profile
« on: October 02, 2009, 06:19:07 pm »

Instead of writing over the same log and destroying its info, each script could have its own log file.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: October 02, 2009, 06:32:52 pm »

Thanks for sharing your idea, I appreciate it. But I'm afraid I disagree, I think a single logfile is better. You can very easily change the name of the logfile if you want, by editing the scripts.
Logged
dev0
JkDefrag Senior
****
Posts: 27


View Profile
« Reply #2 on: October 02, 2009, 08:39:45 pm »

I share woodfold's basic idea.  I've had an instance where I started a defrag and walked away, when I came back and wanted to examine the log file, I noticed it was overwritten by a scheduled defrag which ran after the initial one had finished.  Realizing you can specify the logfile name in the script, sometimes it's cumbersome to have to write multiple scripts that do the same thing, just so you can protect their log file.  As such, I have the following macro suggestions: 

!ScriptName! (for example "OptimizeWeekly")
!TimeStamp! (for example "20091002135501")

This would allow me to define something like:

Code:
WriteLogfile("!ScriptName!-!TimeStamp!.log",STRING)

Which would create a file called: OptimizeWeekly-20091002135501.log

These macros could prove useful in other applications as well.
Logged
woodfold
JkDefrag Senior
****
Posts: 31


View Profile
« Reply #3 on: October 02, 2009, 08:53:21 pm »

After I've modified my scripts, the next update overwrites them, and I have to edit them again. If I change their names, I have to compare the new script contents with my modified ones and edit them to comply with the new instructions.

This latest version, for instance, completely changed the way the scripts were handled. Maybe a Setting command like
UseScriptNameforLog(Yes)
could be added.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #4 on: October 02, 2009, 09:00:00 pm »

Maybe a Setting command like
UseScriptNameforLog(Yes)
could be added.
See the "!ScriptTitle!" macro to use the title of a script in the name of the logfile.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!