3 # Purpose: Log viewer program. Pass it parameters of the logs to view, or it will automatically view some.
4 # Authors: Joey Hess <joey@kitenet.net>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: Unknown (origin: see http://svn.kitenet.net/trunk/bin/logview)
7 ################################################################################
14 # If I am root, look at all logs, otherwise only those that are
17 $perm='-perm +6' if $? != 0;
19 @logfiles=split /\n/, `find $logdir -type f -regex '.*.log' ! -name faillog ! -name lastlog $perm`;
20 push @logfiles, "$logdir/mail.err", "$logdir/mail.warn";
23 if (-e $ENV{HOME}."/.xsession-errors") {
24 push @logfiles, $ENV{HOME}."/.xsession-errors";
27 # Tail without wasting the last line of the screen.
28 open(TAIL, "tail -q --follow=name --retry -n 2 @logfiles|");
35 ## END OF FILE #################################################################