3 # watch the end of the current debug file (like tail -f) applying
4 # any regexes supplied on the command line.
8 # watchdbg g1tlh # watch everything g1tlh does
9 # watchdbg gb7baa gb7djk # watch the conversation between BAA and DJK
14 # search local then perl directories
16 # root of directory tree for this system
18 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
20 unshift @INC, "$root/perl"; # this IS the right way round!
21 unshift @INC, "$root/local";
31 my $fp = DXLog::new('debug', 'dat', 'd');
32 my @today = Julian::unixtoj(time());
33 my $fh = $fp->open(@today) or die $!;
34 my $exp = join '|', @ARGV;
42 printit($line) if $line =~ m{(?:$exp)}oi;
49 # check that the debug hasn't rolled over to next day
51 my @now = Julian::unixtoj(time());
52 if ($today[1] != $now[1]) {
55 for ($i = 0; $i < 20; $i++) {
56 last if $fh = $fp->open(@now);
68 my @line = split '\^', $line;
70 my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time);
71 my $buf = sprintf "%02d:%02d:%02d", $hour, $min, $sec;
73 print $buf, ' ', join('^', @line);