mIRC Home    About    Download    Register    News    Help

Print Thread
Log Viewer #172115 05/03/07 07:48 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Anyone have a good log viewer for dalnet?

Re: Log Viewer [Re: Garou] #172757 15/03/07 04:00 AM
Joined: Jan 2007
Posts: 18
K
kitsaras Offline
Pikka bird
Offline
Pikka bird
K
Joined: Jan 2007
Posts: 18
alias idtlogviewer {
if ($window(@Logviewer) == $null) { window -moabel15 @Logviewer 100 100 450 300 @Logviewer Verdana 12 }
else { clear -l @Logviewer }
window -nls @Loglist Verdana 12
aline -l @Logviewer Log files:
set %logview.num 1
:loop
set %logview.log $findfile($logdir,*.log,%logview.num)
if (%logview.log == $null) { goto part2 }
aline -l @Loglist $nopath(%logview.log)
inc %logview.num 1
goto loop
:part2
set %logview.total $line(@Loglist,0,0)
set %logview.num 1
:loop2
if (%logview.num > %logview.total) { goto end }
aline -l @Logviewer $line(@Loglist,%logview.num)
inc %logview.num 1
goto loop2
:end
aline @Logviewer End log listing.
window -c @Loglist
unset %logview.num %logview.log $logview.total
}
alias logview.viewlog {
if ($1 != $null) {
set %logview.temp $1 $+ .log
set %logview.file $logdir $+ %logview.temp
if ($exists(%logview.file)) {
set %nameof.currentlog %logview.temp
idtlogviewer
clear @Logviewer
aline @Logviewer Viewing %logview.temp ( $+ $file(%logview.file).size bytes):
titlebar @Logviewer ( $+ %logview.temp $+ )
loadbuf -p @Logviewer %logview.file
sline @Logviewer 20
halt
}
}
if (($sline(@Logviewer,1).ln == 1) || ($sline(@Logviewer,1) == $null)) { halt }
set %logview.file $logdir $+ $sline(@Logviewer,1)
set %nameof.currentlog $sline(@Logviewer,1)
clear @Logviewer
aline @Logviewer Viewing  $+ $sline(@Logviewer,1) ( $+ $file(%logview.file).size bytes):
titlebar @Logviewer ( $+ $sline(@Logviewer,1) $+ )
loadbuf -p @Logviewer %logview.file
sline @Logviewer 20
unset %logview.file
}
alias -l logview.search {
if (%nameof.currentlog == $null) { aline @Logviewer 4Error! You must view a log first. | halt }
if ($window(@IDTLogsearch) == $null) { window -moabel @IDTLogsearch 150 150 450 300 @IDTLogsearch Verdana 12 }
else { /clear @IDTLogsearch }
set %logview.file $logdir $+ %nameof.currentlog
titlebar @IDTLogsearch ( $+ %nameof.currentlog $+ )
set %logview.searchstring * [ $+ [ $$?="Text to search for?" ] $+ ] *
aline @IDTLogsearch Searching %nameof.currentlog for %logview.searchstring 
aline @IDTLogsearch [#]____________[Text]________________________________________
filter -fwnp %logview.file @IDTLogsearch %logview.searchstring
unset %logview.*
}
alias -l logview.gotoline {
if (($sline(@IDTLogsearch,1).ln == 1) || ($sline(@IDTLogsearch,1).ln == 2) || ($sline(@IDTLogsearch,1).ln == $null)) { halt }
sline @Logviewer $calc($gettok($sline(@IDTLogsearch,1),1,32) + 2)
window -a @Logviewer
}
alias -l logview.delete {
if (($sline(@Logviewer,1).ln == 1) || ($sline(@Logviewer,1) == $null)) { halt }
set %logview.total $sline(@Logviewer,0)
set %logview.num 1
:loop
if (%logview.num > %logview.total) { goto mid }
set %logview.files %logview.files $sline(@Logviewer,%logview.num) $+ ,
inc %logview.num | goto loop
:mid
set %logview.filen $calc($len(%logview.files) - 1)
set %logview.files $left(%logview.files,%logview.filen)
set %logview.yesno $$?!="Do you want to delete these files ( $+ %logview.files $+ )?"
if (%logview.yesno) {
set %logview.num 1
:loop2
if (%logview.num > %logview.total) { goto end }
set %logview.file $logdir $+ $sline(@Logviewer,%logview.num)
if (%nameof.currentlog == $sline(@Logviewer,%logview.num)) { clear @Logviewer | unset %nameof.currentlog }
.remove %logview.file
inc %logview.num 1 | goto loop2
}
:end
unset %logview.*
idtlogviewer
}

alias -l logview.copy {
if (($sline(@Logviewer,1).ln == 1) || ($sline(@Logviewer,1) == $null)) { halt }
set %logview.total $sline(@Logviewer,0)
set %logview.num 1
:loop
if (%logview.num > %logview.total) { goto mid }
set %logview.files %logview.files $sline(@Logviewer,%logview.num) $+ ,
inc %logview.num | goto loop
:mid
set %logview.filen $calc($len(%logview.files) - 1)
set %logview.files $left(%logview.files,%logview.filen)
set %logview.yesno $$?!="Do you want to copy these files ( $+ %logview.files $+ )?"
if (%logview.yesno) {
set %logview.dir $$sdir="Select a directory to copy to:"
set %logview.num 1
:loop2
if (%logview.num > %logview.total) { goto end }
set %logview.file $logdir $+ $sline(@Logviewer,%logview.num)
if (%nameof.currentlog == $sline(@Logviewer,%logview.num)) { clear @Logviewer | unset %nameof.currentlog }
copy %logview.file [ %logview.dir ] $+ $sline(@Logviewer,%logview.num)
inc %logview.num 1 | goto loop2
}
:end
unset %logview.*
idtlogviewer
}

alias -l logview.rename {
if (($sline(@Logviewer,1).ln == 1) || ($sline(@Logviewer,1) == $null)) { halt }
set %logview.total $sline(@Logviewer,0)
set %logview.num 1
:loop
if (%logview.num > %logview.total) { goto mid }
set %logview.files %logview.files $sline(@Logviewer,%logview.num) $+ ,
inc %logview.num | goto loop
:mid
set %logview.filen $calc($len(%logview.files) - 1)
set %logview.files $left(%logview.files,%logview.filen)
set %logview.yesno $$?!="Do you want to rename these files ( $+ %logview.files $+ )?"
if (%logview.yesno) {
set %logview.num 1
:loop2
if (%logview.num > %logview.total) { goto end }
set %logview.file $logdir $+ $sline(@Logviewer,%logview.num)
if (%nameof.currentlog == $sline(@Logviewer,%logview.num)) { clear @Logviewer | unset %nameof.currentlog }
rename $logdir $+ $sline(@Logviewer,%logview.num) $logdir $+ $$?="Please enter a new file name for $sline(@Logviewer,%logview.num) $+ :"
inc %logview.num 1 | goto loop2
}
:end
unset %logview.*
idtlogviewer
}
alias -l logview.notepad {
if (($sline(@Logviewer,1).ln == 1) || ($sline(@Logviewer,1) == $null)) { halt }
set %logview.total $sline(@Logviewer,0)
set %logview.num 1
:loop
if (%logview.num > %logview.total) { goto end }
set %logview.file $logdir $+ $sline(@Logviewer,%logview.num)
run notepad.exe %logview.file
inc %logview.num
goto loop
:end
unset %logview.*
idtlogviewer
}

menu @Logviewer {
List logs:/idtlogviewer
View log:/logview.viewlog $sline(@Logviewer,1)
Search log:/logview.search
Copy logs:/logview.copy
Delete logs:/logview.delete
Rename logs:/logview.rename
Open logs in notepad:/logview.notepad
Clear:/clear @Logviewer
Close:/window -c @Logviewer
}
menu @IDTLogsearch {
dclick /logview.gotoline
Goto line:/logview.gotoline
Close:/window -c @IDTLogsearch
ReSearch:/logview.search
}
menu {
-
Log Viewer:/idtlogviewer
}

on *:CLOSE:@Logviewer: { unset %nameof.currentlog }
on 1:UNLOAD: { unset %nameof.currentlog %logview.* }

Re: Log Viewer [Re: kitsaras] #172761 15/03/07 04:23 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Please use the Code Tags when posting code in the forums. If you're unsure of which button is for the Code Tags, it looks like #

Re: Log Viewer [Re: RusselB] #174204 03/04/07 10:43 PM
Joined: Jan 2007
Posts: 18
K
kitsaras Offline
Pikka bird
Offline
Pikka bird
K
Joined: Jan 2007
Posts: 18
sorry RusselB

Code:
 i will :/

Last edited by kitsaras; 03/04/07 10:46 PM.