diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2008-06-17 17:15:26 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2008-06-17 17:15:26 +0000 |
commit | 1cde0c244a5bbe5a88390b327f5da3eae47909bb (patch) | |
tree | 311b150f6dfa06c7f34ece13f68435ea93105ff7 /modules/OutputMessage.pm | |
parent | 821e676d9ff0c53f73f99ed68bd0113bd3c62add (diff) | |
download | MPC-1cde0c244a5bbe5a88390b327f5da3eae47909bb.tar.gz |
ChangeLogTag: Tue Jun 17 17:16:07 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/OutputMessage.pm')
-rw-r--r-- | modules/OutputMessage.pm | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/modules/OutputMessage.pm b/modules/OutputMessage.pm index f6b53920..855b4d14 100644 --- a/modules/OutputMessage.pm +++ b/modules/OutputMessage.pm @@ -16,30 +16,29 @@ use strict; # Data Section # ************************************************************ -my($debugtag) = 'DEBUG: '; -my($infotag) = 'INFORMATION: '; -my($warntag) = 'WARNING: '; -my($errortag) = 'ERROR: '; +my $debugtag = 'DEBUG: '; +my $infotag = 'INFORMATION: '; +my $warntag = 'WARNING: '; +my $errortag = 'ERROR: '; -my($debug) = 0; -my($information) = 0; -my($warnings) = 1; -my($diagnostic) = 1; -my($details) = 1; +my $debug = 0; +my $information = 0; +my $warnings = 1; +my $diagnostic = 1; +my $details = 1; # ************************************************************ # Subroutine Section # ************************************************************ sub new { - my($class) = shift; - return bless { - }, $class; + my $class = shift; + return bless {}, $class; } sub set_levels { - my($str) = shift; + my $str = shift; if (defined $str) { $debug = ($str =~ /debug\s*=\s*(\d+)/i ? $1 : 0); @@ -51,9 +50,7 @@ sub set_levels { } sub split_message { - my($self) = shift; - my($msg) = shift; - my($spc) = shift; + my($self, $msg, $spc) = @_; $msg =~ s/\.\s+/.\n$spc/g; return $msg . "\n"; @@ -62,8 +59,7 @@ sub split_message { sub details { if ($details) { - my($self) = shift; - my($msg) = shift; + my($self, $msg) = @_; print "$msg\n"; } } @@ -71,8 +67,7 @@ sub details { sub diagnostic { if ($diagnostic) { - my($self) = shift; - my($msg) = shift; + my($self, $msg) = @_; print "$msg\n"; } } @@ -80,8 +75,7 @@ sub diagnostic { sub debug { if ($debug) { - my($self) = shift; - my($msg) = shift; + my($self, $msg) = @_; print "$debugtag$msg\n"; } } @@ -89,8 +83,7 @@ sub debug { sub information { if ($information) { - my($self) = shift; - my($msg) = shift; + my($self, $msg) = @_; print $infotag . $self->split_message($msg, ' ' x length($infotag)); } } @@ -98,17 +91,14 @@ sub information { sub warning { if ($warnings) { - my($self) = shift; - my($msg) = shift; + my($self, $msg) = @_; print $warntag . $self->split_message($msg, ' ' x length($warntag)); } } sub error { - my($self) = shift; - my($msg) = shift; - my($pre) = shift; + my($self, $msg, $pre) = @_; if (defined $pre) { print STDERR "$pre\n"; |