2 # Log Printing routines
4 # Copyright (c) - 1998 Dirk Koopman G1TLH
22 # print some items from the log backwards in time
24 # This command outputs a list of n lines starting from time t with $pattern tags
28 my $self = $DXLog::log;
31 my @date = $self->unixtoj(shift);
39 $search = $pattern ? "\$ref->[1] =~ /$pattern/" : '1' ;
43 for (\$c = \$#in; \$c >= 0; \$c--) {
47 next if \$count < $from;
48 push \@out, print_item(\$ref);
49 last LOOP if \$count >= \$to; # stop after n
54 $self->close; # close any open files
56 my $fh = $self->open(@date);
58 while ($count < $to) {
63 push @in, [ split '\^' ];
65 eval $eval; # do the search on this file
66 return ("Spot search error", $@) if $@;
68 $fh = $self->openprev(); # get the next file
76 # the standard log printing interpreting routine.
78 # every line that is printed should call this routine to be actually visualised
80 # Don't really know whether this is the correct place to put this stuff, but where
83 # I get a reference to an array of items
89 my $d = atime($ref[0]);
92 if ($ref[1] eq 'rcmd') {
93 if ($ref[2] eq 'in') {
94 $s = "$ref[4] (priv: $ref[3]) rcmd: $ref[5]";
96 $s = "$ref[3] reply: $ref[4]";
98 } elsif ($ref[1] eq 'talk') {
99 $s = "$ref[3] -> $ref[2] ($ref[4]) $ref[5]";
100 } elsif ($ref[1] eq 'ann') {
101 $s = "$ref[2] -> $ref[3] $ref[4]";