Page 1 of 3

Log is great! 2 Suggestions:

Posted: 2006-11-08, 15:00 UTC
by JohnFredC
The potential to parse the log file and produce an AHK or VBS or BAT script is really wonderful. I have already starting using the log as an activity "recorder"... that is, parsing the contents of the log and converting them to bat files for future re-use.

Currently my code identifies spaces in the logfile in order to separate the dates from the commands and filenames and so-on. It would help if TC supported:


1. A fixed-width date/time format in the log

This would make parsing the line slightly faster. Currently the time values are variable-width.


2. An internal command to put a separator or comment in the log

Though I guess it is easy-enough to write an external utility for this, something like cm_PostLogComment with a popup dialog that would allow me to enter some text to be posted in the log.

It would be helpful if I could store some default text for the command in the TC ini file.

Posted: 2006-11-09, 07:20 UTC
by Sosna
support +

Posted: 2006-11-09, 17:14 UTC
by ghisler(Author)
A fixed-width date/time format in the log
Should be doable.
An internal command to put a separator or comment in the log
Hmm, what for?

Posted: 2006-11-09, 17:57 UTC
by JohnFredC
Hi Christian

This log thing is really excellent. Has got me quite excited, actually.

Having a comment in the log would help me distinguish groups of file operations related to specific objectives. This would be helpful for a log parser (either myself or code I have written) to search for and identify sections of the log relevant to a particular project, even if it has been several days since.

I might want to post a simple divider for instance:

[face=courier]11/09/2006 12:00:02 PM Program Start
=========================================
11/09/2006 12:00:59 PM NewFolder etc.
11/09/2006 12:01:21 PM NewFolder etc.
11/09/2006 12:01:49 PM Copy etc. etc.
=========================================
11/09/2006 12:06:02 PM Move etc. etc.[/face]

Or I might add some info:

[face=courier]11/09/2006 12:00:02 PM Program Start
=====Setup test SMJ Project environment==
11/09/2006 12:00:59 PM NewFolder etc.
11/09/2006 12:01:21 PM NewFolder etc.
11/09/2006 12:01:49 PM Copy etc. etc.
=========================================
11/09/2006 12:06:02 PM Move etc. etc.[/face]

Or even blank lines:

[face=courier]11/09/2006 12:00:02 PM Program Start

=====Setup test SMJ Project environment==
11/09/2006 12:00:59 PM NewFolder etc.
11/09/2006 12:01:21 PM NewFolder etc.
11/09/2006 12:01:49 PM Copy etc. etc.
=========================================

11/09/2006 12:06:02 PM Move etc. etc.[/face]

Posted: 2006-11-09, 18:04 UTC
by JohnFredC
Another request related to logs:

Log version info is currently written to the log file name AFTER the extension:

[face=courier]TCLog.txt
TCLog.txt.20061105
TCLog.txt.20061106
TCLog.txt.20061107[/face]

Would you consider placing the date/version info prior to the extension?

[face=courier]TCLog.txt
TCLog.20061105.txt
TCLog.20061106.txt
TCLog.20061107.txt[/face]

The reason for the request is simply that using the date as the extension breaks the Lister plugin-association for the extension and causes QuickView (for instance) to revert to the built-in lister instead of the plugin assigned to that filetype.

Posted: 2006-11-10, 14:48 UTC
by JohnFredC
2Christian

I withdraw my Request of a function to post a comment to the log.

One line of AHK does it for a simple divider. And a dialog doesn't take much more code.

Thanks for listening though.

Posted: 2006-11-10, 15:12 UTC
by SanskritFritz
2JohnFredC
Can you please explain?
One line of AHK does it for a simple divider.

Posted: 2006-11-10, 16:54 UTC
by Hacker
SanskritFritz,

Code: Select all

FileAppend, ==================, %TEMP%\log.txt
Roman

Posted: 2006-11-10, 17:25 UTC
by SanskritFritz
2Hacker
I almost fell offended now ;-) Well, obviously that was not my question. I rather think that JohnFredC has built a convenient way to put some info into the logfile from within TC.
Another concern: what if both programs (AHK and TC) try to open the logfile simultaneously for writing?

Posted: 2006-11-10, 17:43 UTC
by ghisler(Author)
Would you consider placing the date/version info prior to the extension?
I will consider that. It will break current log file rotation, though because the names no longer match.

Posted: 2006-11-10, 17:51 UTC
by SanskritFritz
I also support keeping the rotated logfile extension!

Posted: 2006-11-10, 21:01 UTC
by JohnFredC
SanskritFritz wrote: I rather think that JohnFredC has built a convenient way to put some info into the logfile from within TC.
Not really, I just put something together real fast. The AHK code is 1 line:

[face=courier]FileAppend,%1%`n,LogFilePathSpecHere[/face]

Replace that last parameter with the name/path of the text file (ie., log) in question. I compiled this line (for convenience) and put the executable on a TC button with the following Parameters line:

[face=courier]?=====================[/face]

So when I click the button on the TC toolbar, the TC ? dialog appears with the default text displayed, which I can then override with any appropriate text, making sure to use quotes when spaces are involved.
SanskritFritz wrote:Another concern: what if both programs (AHK and TC) try to open the logfile simultaneously for writing?
That certainly could be an issue sometimes, but probably not often, at least for me.

Posted: 2006-11-10, 21:05 UTC
by SanskritFritz
Thanks, JohnFredC the idea is really nice.

Posted: 2006-11-15, 03:23 UTC
by byblo
SanskritFritz wrote:I also support keeping the rotated logfile extension!
I support too.

Posted: 2006-11-15, 17:17 UTC
by ghisler(Author)
Currently the time values are variable-width.
I cannot confirm this here - can you post a small part of your log file with this problem, please?