3 # ************************************************************
4 # Description : Prints information, warnings and errors.
5 # Author : Chad Elliott
6 # Create Date : 2/02/2004
7 # ************************************************************
9 # ************************************************************
11 # ************************************************************
15 # ************************************************************
17 # ************************************************************
19 my $debugtag = 'DEBUG: ';
20 my $infotag = 'INFORMATION: ';
21 my $warntag = 'WARNING: ';
22 my $errortag = 'ERROR: ';
30 # ************************************************************
32 # ************************************************************
36 return bless {}, $class;
44 $debug = ($str =~ /debug\s*=\s*(\d+)/i ?
$1 : 0);
45 $details = ($str =~ /detail(s)?\s*=\s*(\d+)/i ?
$2 : 0);
46 $diagnostic = ($str =~ /diag(nostic)?\s*=\s*(\d+)/i ?
$2 : 0);
47 $information = ($str =~ /info(rmation)?\s*=\s*(\d+)/i ?
$2 : 0);
48 $warnings = ($str =~ /warn(ing)?\s*=\s*(\d+)/i ?
$2 : 0);
52 ## Accessor for the debug setting. No parameters are necessary.
58 my($self, $msg, $spc) = @_;
59 $msg =~ s/\n+/\n$spc/g;
60 $msg =~ s/\.\s+/.\n$spc/g;
67 #my($self, $msg) = @_;
75 #my($self, $msg) = @_;
83 #my($self, $msg) = @_;
84 print "$debugtag$_[1]\n";
91 #my($self, $msg) = @_;
92 print $infotag, $_[0]->split_message($_[1], ' ' x
length($infotag));
99 #my($self, $msg) = @_;
100 print $warntag, $_[0]->split_message($_[1], ' ' x
length($warntag));
106 my($self, $msg, $pre) = @_;
107 print STDERR
'', (defined $pre ?
"$pre\n" : ''), $errortag,
108 $self->split_message($msg, ' ' x
length($errortag));