diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-09-29 22:33:31 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-09-29 22:33:31 +0000 |
commit | 9027491ae154280094ecf292dc5a8953532363cb (patch) | |
tree | a4f9997ee074fe8c9bd55e891965e84941060982 /contrib | |
parent | 174c3dc6b7d571e33b384a976e23c838cf2bfa80 (diff) | |
download | tor-9027491ae154280094ecf292dc5a8953532363cb.tar.gz tor-9027491ae154280094ecf292dc5a8953532363cb.zip |
r9022@Kushana: nickm | 2006-09-29 17:26:58 -0400
Improve log-duplicate-checker to ignore LD_BUG messages.
svn:r8540
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/checkLogs.pl | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/contrib/checkLogs.pl b/contrib/checkLogs.pl index 9a5e287f52..b00503e9ab 100644 --- a/contrib/checkLogs.pl +++ b/contrib/checkLogs.pl @@ -8,30 +8,36 @@ my $last = ""; while (<>) { if ($more) { - if (/\s*(?:LD_[A-Z]*,)?\"((?:[^\"\\]+|\\.*)+)\"(.*)/) { + if (/LD_BUG/) { + $more = 0; + next; + } + if (/\"((?:[^\"\\]+|\\.*)+)\"(.*)/) { $last .= $1; if ($2 !~ /[,\)]/) { $more = 1; } else { - $count{$last}++; + $count{lc $last}++; $more = 0; } } elsif (/[,\)]/) { - $count{$last}++; + $count{lc $last}++; $more = 0; } elsif ($more == 2) { print "SKIPPED more\n"; } - } elsif (/log_(?:warn|err|notice)\([^\"]*\"((?:[^\"\\]+|\\.)*)\"(.*)/) { - my $s = $1; - if ($2 =~ /[,\)]/ ) { - $count{$s}++; + } elsif (/log_(?:warn|err|notice)\(\s*(LD_[A-Z_]*)\s*,\s*\"((?:[^\"\\]+|\\.)*)\"(.*)/) { + next if ($1 eq 'LD_BUG'); + my $s = $2; + if ($3 =~ /[,\)]/ ) { + $count{lc $s}++; } else { $more = 1; $last = $s; } - } elsif (/log_(?:warn|err|notice)\((?:LD_[A-Z]*,)?(.*)/) { - my $extra = $1; + } elsif (/log_(?:warn|err|notice)\(\s*((?:LD_[A-Z_]*)?)(.*)/) { + next if ($1 eq 'LD_BUG'); + my $extra = $2; chomp $extra; $last = ""; $more = 2 if ($extra eq ''); |