diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2005-05-16 11:49:54 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2005-05-16 11:49:54 +0000 |
commit | 987bae628b60ded8ca0aca53d305392642ee0fa3 (patch) | |
tree | 3118510032df332f29a136820e1b26b3d2c3eb1a /modules/Parser.pm | |
parent | b1e5b29a7ae81c721cad781078b048aba2b5527a (diff) | |
download | MPC-987bae628b60ded8ca0aca53d305392642ee0fa3.tar.gz |
ChangeLogTag: Mon May 16 06:47:57 2005 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/Parser.pm')
-rw-r--r-- | modules/Parser.pm | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/modules/Parser.pm b/modules/Parser.pm index fb2db92a..2c0ab234 100644 --- a/modules/Parser.pm +++ b/modules/Parser.pm @@ -25,6 +25,8 @@ use vars qw(@ISA); # ************************************************************ my(%filecache) = (); +my($silent) = 'MPC_SILENT'; +my($logging) = 'MPC_LOGGING'; # ************************************************************ # Subroutine Section @@ -33,11 +35,26 @@ my(%filecache) = (); sub new { my($class) = shift; my($inc) = shift; - my($info) = (defined $ENV{MPC_SILENT} || - !defined $ENV{MPC_INFORMATION} ? 0 : 1); - my($warn) = (defined $ENV{MPC_SILENT} ? 0 : 1); - my($diag) = (defined $ENV{MPC_SILENT} ? 0 : 1); - my($self) = $class->SUPER::new($info, $warn, $diag); + my($log) = $ENV{$logging}; + + ## The order of these array variables must correspond to the + ## order of the parameters to OutputMessage::new(). + my($params) = (defined $ENV{$silent} || + defined $log ? [0, 0, 0] : [0, 1, 1]); + + if (defined $log) { + if ($log =~ /info(rmation)?\s*=\s*(\d+)/i) { + $$params[0] = $2; + } + if ($log =~ /warn(ing)?\s*=\s*(\d+)/i) { + $$params[1] = $2; + } + if ($log =~ /diag(nostic)?\s*=\s*(\d+)/i) { + $$params[2] = $2; + } + } + + my($self) = $class->SUPER::new(@$params); $self->{'line_number'} = 0; $self->{'include'} = $inc; |