Log is great! 2 Suggestions:

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Log is great! 2 Suggestions:

Post 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.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
Sosna
Member
Member
Posts: 143
Joined: 2006-10-24, 10:52 UTC

Post by *Sosna »

support +
Ave Caesar Imperator,
moritari te salutant!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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?
Author of Total Commander
https://www.ghisler.com
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post 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]
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post 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.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post 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.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2JohnFredC
Can you please explain?
One line of AHK does it for a simple divider.
I switched to Linux, bye and thanks for all the fish!
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

SanskritFritz,

Code: Select all

FileAppend, ==================, %TEMP%\log.txt
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post 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?
I switched to Linux, bye and thanks for all the fish!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

I also support keeping the rotated logfile extension!
I switched to Linux, bye and thanks for all the fish!
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post 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.
Last edited by JohnFredC on 2006-11-10, 22:51 UTC, edited 1 time in total.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Thanks, JohnFredC the idea is really nice.
I switched to Linux, bye and thanks for all the fish!
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

SanskritFritz wrote:I also support keeping the rotated logfile extension!
I support too.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post 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?
Author of Total Commander
https://www.ghisler.com
Post Reply