ann: logtail.wlx/auto file change tailing viewer

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

ann: logtail.wlx/auto file change tailing viewer

Post by *hpg »

Hey,

just a simple lister plugin which makes an auto tail of a given logfile.
If the logfile changes the tail is automatically refreshed.

Some special features:
add extensions to ini file of logtail.ini (is created automatically where tcmd is saving its ini file)

lines in logfiles that starts with
'I(TAB)' are treated as infos
'W(TAB)' are treated as warnigns and are displayed in yellow colour
'E(TAB)' are treated as errors and are displayed in red colour
'U(TAB)' are treated as urgent errors and are displayed in black/red colour

So if you are developing a new app and have the option to define your own logfile format you may use these format :-)

When using this format also a history of all warnings and errors is maintained. You can navigate to next/previous error, warning...

Note: still early alpha phase, comments and suggestions are welcomed
Download: http://liveordead.de/free/logtailpl.zip

Have fun
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-10, 20:39 UTC, edited 1 time in total.
User avatar
henrich.fukna
Junior Member
Junior Member
Posts: 60
Joined: 2003-03-07, 10:18 UTC
Location: Bratislava, Slovakia

Post by *henrich.fukna »

Ad. 1: it works for me to :D
Ad. 2: i must clik mouse in windows content, then keyborad works...why ?
Ad. 3: for me works with all files (i have at least order; select Options -> Image/Multimedia) 8)
Ad. 4: it's my suggestion too: i use log4j logger... there are "DEBUG", "INFO", "WARN", "ERROR", "FATAL" loggining priority. Config like priority (text), position in the line is welcome

Henrich
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

Post by *hpg »

Ad. 2: i must clik mouse in windows content, then keyborad works...why ?
This is because the plugin does not make an auto setfocus, in CTRL-F3 mode (and I think you should use preferred this mode!) you can simple
hit the TAB key...
Ad. 3: for me works with all files (i have at least order; select Options -> Image/Multimedia) 8)
Yes, good idea, Shift-Up or Down in Lister-Config all works fine.
Ad. 4: it's my suggestion too: i use log4j logger... there are "DEBUG", "INFO", "WARN", "ERROR", "FATAL" loggining priority. Config like priority (text), position in the line is welcome
Henrich
Probably in next versions :-)
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

Post by *hpg »

norfie wrote: 3rd: LOGTAIL.INI: "Options.AssociatedExts=.logs" for what is this useful?
I add to wincmd.ini
9=PLUGINS\Logtail_plugin.wlx
9_detect="ext="LOG""
So this plugin will be used with file with extension "log" only.
Ok, my description was too short, so:

Add any other extension as a comma separated list in logtail.ini (The ini file should be saved automatically when you first run logtail_plugin).
Example:
Options.AssociatedExts=.logs,.stat,.txt

So the plugin associates itself in lister for files with the given extensions.
The 9_detect will not be found because the logtail uses its own ini file.
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-10, 20:39 UTC, edited 1 time in total.
User avatar
Lion
Junior Member
Junior Member
Posts: 55
Joined: 2003-05-26, 09:36 UTC
Location: Obninsk, Russia
Contact:

Post by *Lion »

Getting the same thing as norfie.
Everithing else seem to work fine.
Waiting for configurable priority strings... ;)
"It's all very simple: In a white cloak..." - M. Bulgakov. The Master and Margarita.
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

Post by *hpg »

Lion wrote:Getting the same thing as norfie.
Everithing else seem to work fine.
Waiting for configurable priority strings... ;)
Ok, tell me more about configurable priority strings, how should I implement them? I have no good idea...
User avatar
Lion
Junior Member
Junior Member
Posts: 55
Joined: 2003-05-26, 09:36 UTC
Location: Obninsk, Russia
Contact:

Post by *Lion »

hpg
Well, first what comes to mind...
1. The number of log message types can be different.
2. Position in line to search from must be configured, for every message type just in case (and the thanks goes to... henrich.fukna ;)).
3. Configurable colors
4. Template for the "SUMMARY" line
...
n. :roll:

So the ini section might look like this:

Code: Select all

[MessageTypes]
SummaryFmt=Warnings: %M3%\tErrors: %M4%
MsgString1=DBG
MsgPos1=1
MsgColorText1=$000000
MsgColorBg1=$FFFFFF
MsgString2=INF
MsgPos2=6
MsgString3=WRN
MsgPos3=1
MsgString4=ERR
MsgPos4=10
...
"It's all very simple: In a white cloak..." - M. Bulgakov. The Master and Margarita.
User avatar
Lion
Junior Member
Junior Member
Posts: 55
Joined: 2003-05-26, 09:36 UTC
Location: Obninsk, Russia
Contact:

Post by *Lion »

Possible bug?
1. View log file
2. Delete viewed file
3. Try to delete the directory where was that file!
Sometimes I can't even enter this dir.
THE CAUSE: it remains opened by TC's process if you look at opened files using any corresponding utility like TaskInfo.
And, of course, TC restart helps.
"It's all very simple: In a white cloak..." - M. Bulgakov. The Master and Margarita.
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

Post by *hpg »

Code: Select all

[MessageTypes]
SummaryFmt=Warnings: %M3%\tErrors: %M4%
MsgString1=DBG
MsgPos1=1
MsgColorText1=$000000
MsgColorBg1=$FFFFFF
MsgString2=INF
MsgPos2=6
MsgString3=WRN
MsgPos3=1
MsgString4=ERR
MsgPos4=10
...
Ok, its seemes not to be flexible enough to me. The Types must be declared elsewhere in another section:

Code: Select all

[MsgTypes]
Count=3
Item0=WARN
Item1=ERROR
Item2=INFO

[Error]
Name=Error
Color=RGB(255,0,0)
Match=^.+ERR
...
I would prefer to use a regexp if it is necessary to make it configurable.
I encountered one problem, because I have to match the original line once and the displayed line in the editor again. And the same line is tranformed by the editor LF -> CR LF or TAB -> 3 Whitespaces etc.
I don't know how to handle this now.
Note: this is necessary because of performance and less cpu usage purposes :-(
hpg
Junior Member
Junior Member
Posts: 79
Joined: 2003-03-16, 12:20 UTC

Post by *hpg »

Possible bug?
1. View log file
2. Delete viewed file
3. Try to delete the directory where was that file!
Sometimes I can't even enter this dir.
THE CAUSE: it remains opened by TC's process if you look at opened files using any corresponding utility like TaskInfo.
And, of course, TC restart helps.
Hm ok, I have to check this, probably the DirectoryChangeNotifcation is not cleared correctly, did you close the logtail plugin before deleting the file?
User avatar
Lion
Junior Member
Junior Member
Posts: 55
Joined: 2003-05-26, 09:36 UTC
Location: Obninsk, Russia
Contact:

Post by *Lion »

did you close the logtail plugin before deleting the file
Yes.
"It's all very simple: In a white cloak..." - M. Bulgakov. The Master and Margarita.
User avatar
henrich.fukna
Junior Member
Junior Member
Posts: 60
Joined: 2003-03-07, 10:18 UTC
Location: Bratislava, Slovakia

Post by *henrich.fukna »

Match=^.+ERR
What do you mean with this?
I would prefer to use a regexp if it is necessary to make it configurable.
ok
  • For example log4j (log4c++ :?: ) message pattern
    %d{ISO8601} %-10.15t %-5.5p: %m%n

    %d{ISO8601} - date: ISO8601 format
    %-10.15t - thread: "-" right allign with spaces; "10" pad with spaces if thread name is less than 10 chars"; ".15" truncate from beginning if thread name is longer than 15 chars
    %-5.5p - logging priority (only and only 5 chars with right allign with spaces)
    : - "colon"
    %m - user defined message
    %n - "new line"
I encountered one problem, because I have to match the original line once and the displayed line in the editor again. And the same line is tranformed by the editor LF -> CR LF or TAB -> 3 Whitespaces etc.
I don't know how to handle this now.
Note: this is necessary because of performance and less cpu usage purposes
I don't understand why you convert the chars. All is white-space.

Henrich
Post Reply