Allow TEST_VERBOSE to control level of verbosity.
Defaults to 3. 'verbose' option now has precedence if set.
This commit is contained in:
parent
fdca9bd57a
commit
5db0c0bbf7
1 changed files with 6 additions and 1 deletions
7
stow.in
7
stow.in
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue