diff --git a/webtools/tinderbox2/src/default_conf/Error_Parse.pm b/webtools/tinderbox2/src/default_conf/Error_Parse.pm index fbaf285e38d6..bcb0ffb36e30 100644 --- a/webtools/tinderbox2/src/default_conf/Error_Parse.pm +++ b/webtools/tinderbox2/src/default_conf/Error_Parse.pm @@ -5,8 +5,8 @@ # errors and creating links into the source code where the errors # occurred. -# $Revision: 1.7 $ -# $Date: 2002/02/25 19:30:14 $ +# $Revision: 1.8 $ +# $Date: 2002/05/02 01:39:47 $ # $Author: kestes%walrus.com $ # $Source: /home/hwine/cvs_conversion/cvsroot/mozilla/webtools/tinderbox2/src/default_conf/Error_Parse.pm,v $ # $Name: $ @@ -67,16 +67,24 @@ $VERSION = '#tinder_version#'; # tuned version can take up 50% (as shown by perl -d:DProf ) of the # execution time. -%LINE_TYPE2COLOR = ( - 'error' => "navy", - 'warning' => "maroon", - 'info' => "black", - ); +%ERRORTYPE = ( + 'error' => { + 'html_color'=> "navy", + 'handler'=> \&main::null, + }, + 'warning' => { + 'html_color'=> "maroon", + 'handler'=> \&main::null, + }, + 'info' => { + 'html_color'=> "black", + 'handler'=> \&main::null, + }, + ); # This block adjusts how we format the error logs, perhaps it belongs # in another file and not the error_parse file. Processmail is a # candidate. - { # window of context arround error message, for summary log @@ -93,6 +101,27 @@ $LINENO_COLUMN = 6; } +sub type2color { + my ($type) = @_; + $out = $ERRORTYPE{$type}{'html_color'}; + return $out; +} + +# run the handler associated with the status given as input. + +sub run_status_handler { + my (%args) = @_; + + my ($line_type) = $args{'line_type'}; + + # run status dependent hook. + &{$ERRORTYPE{$line_type}{'handler'}}(%args); + + # notice handlers never return any values. + + return ; +} + package Error_Parse::unix; @@ -100,7 +129,7 @@ package Error_Parse::unix; sub line_type { my ($line) = @_; - $error = ( + my $error = ( ($line =~ /\sORA-\d/) || # Oracle ($line =~ /\bNo such file or directory\b/) || @@ -112,6 +141,7 @@ sub line_type { ($line =~ /\b[Cc]an not\b/) || # javac error ($line =~ /\b\[javac\]\b/) || # javac error # Remember: some source files are called $prefix/error.suffix + ($line =~ /\bDied\b/) || # Perl error ($line =~ /\b(?