2 # Log Printing routines
4 # Copyright (c) - 1998 Dirk Koopman G1TLH
21 # print some items from the log backwards in time
23 # This command outputs a list of n lines starting from time t with $pattern tags
27 my $fcb = $DXLog::log;
30 my @date = Julian::unixtojm(shift);
41 $search = "\$ref->[1] =~ m{^$pattern}i";
42 $hint = "m{$pattern}i";
49 $search .= "(\$ref->[2] =~ m{$who}i || \$ref->[3] =~ m{$who}i)";
52 $hint = "next unless $hint" if $hint;
53 $search = "1" unless $search;
60 \$ref = [ split '\\^' ];
61 push \@\$ref, "" unless \@\$ref >= 4;
65 for (\$c = \$#in; \$c >= 0; \$c--) {
69 next if \$count < $from;
70 push \@out, print_item(\$ref);
71 last if \$count >= \$to; # stop after n
76 $fcb->close; # close any open files
78 my $fh = $fcb->open(@date);
79 for ($count = 0; $count < $to; ) {
82 eval $eval; # do the search on this file
83 last if $count >= $to; # stop after n
84 return ("Log search error", $@) if $@;
86 $fh = $fcb->openprev(); # get the next file
94 # the standard log printing interpreting routine.
96 # every line that is printed should call this routine to be actually visualised
98 # Don't really know whether this is the correct place to put this stuff, but where
101 # I get a reference to an array of items
107 my $d = atime($ref[0]);
110 if ($ref[1] eq 'rcmd') {
111 if ($ref[2] eq 'in') {
112 $s = "$ref[4] (priv: $ref[3]) rcmd: $ref[5]";
114 $s = "$ref[3] reply: $ref[4]";
116 } elsif ($ref[1] eq 'talk') {
117 $s = "$ref[3] -> $ref[2] ($ref[4]) $ref[5]";
118 } elsif ($ref[1] eq 'ann') {
119 $s = "$ref[3] -> $ref[2] $ref[4]";