diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2006-07-11 11:42:26 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2006-07-11 11:42:26 +0000 |
commit | 69e64320e754bc3600c1b292857f0a8850e072ce (patch) | |
tree | 98001c260ada3448b3aed8c3bd4cfaad9e35129c /modules/Parser.pm | |
parent | 879e6a2242d98121e58ffd07cf61f3b947a9db80 (diff) | |
download | MPC-69e64320e754bc3600c1b292857f0a8850e072ce.tar.gz |
ChangeLogTag: Tue Jul 11 11:42:25 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/Parser.pm')
-rw-r--r-- | modules/Parser.pm | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/modules/Parser.pm b/modules/Parser.pm index 73be88ae..65930eba 100644 --- a/modules/Parser.pm +++ b/modules/Parser.pm @@ -35,29 +35,18 @@ my($logging) = 'MPC_LOGGING'; sub new { my($class) = shift; my($inc) = shift; - 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] : [0, 1, 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; - } - if ($log =~ /detail(s)?\s*=\s*(\d+)/i) { - $$params[3] = $2; - } + my($params) = (defined $ENV{$silent} ? [0, 0, 0, 0, 0] : undef); + if (defined $params) { + print "NOTE: $silent is deprecated. See the USAGE file for details.\n"; + } + my($self) = $class->SUPER::new($params); + if (defined $ENV{$logging}) { + print "NOTE: $logging is deprecated. See the USAGE file for details.\n"; + OutputMessage::set_levels($ENV{$logging}); } - - my($self) = $class->SUPER::new(@$params); $self->{'line_number'} = 0; $self->{'include'} = $inc; @@ -97,6 +86,7 @@ sub read_file { $self->{'line_number'} = 0; if (open($ih, $input)) { + $self->debug("Open $input"); if ($cache) { ## If we don't have an array for this file, then start one if (!defined $filecache{$input}) { @@ -126,6 +116,7 @@ sub read_file { } } } + $self->debug("Close $input"); close($ih); } else { |