Allow TEST_VERBOSE to control level of verbosity.

Defaults to 3.  'verbose' option now has precedence if set.
This commit is contained in:
Adam Spiers 2011-11-18 10:29:15 +00:00
parent fdca9bd57a
commit 5db0c0bbf7

View file

@ -264,7 +264,12 @@ sub process_options {
sub debug { sub debug {
my ($level, $msg) = @_; my ($level, $msg) = @_;
if ($Option{'testmode'}) { if ($Option{'testmode'}) {
print "# $msg\n" if $ENV{TEST_VERBOSE}; $ENV{TEST_VERBOSE} = 3
if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/;
$Option{'verbose'} = $ENV{TEST_VERBOSE}
if $ENV{TEST_VERBOSE} && ! $Option{'verbose'};
print "# $msg\n"
if $Option{'verbose'} >= $level;
} }
elsif ($Option{'verbose'} >= $level) { elsif ($Option{'verbose'} >= $level) {
warn "$msg\n"; warn "$msg\n";