Subject: | $logger->more_logging(0) should not increase log level |
Date: | Wed, 30 Apr 2014 20:09:32 +0000 |
To: | "bug-Log-Log4perl [...] rt.cpan.org" <bug-Log-Log4perl [...] rt.cpan.org> |
From: | "Wolff, Nic" <nwolff [...] hearst.com> |
http://search.cpan.org/~mschilli/Log-Log4perl-1.43/lib/Log/Log4perl.pm#Changing_the_Log_Level_on_a_Logger
gives the example
my $v = 0; # default level of verbosity.
GetOptions("v+" => \$v, ...);
$logger->more_logging($v); # inc logging level once for each -v in ARGV
which doesn't work, since in Log::Log4Perl::Logger we have
sub more_logging {
my ($self) = shift;
return $self->dec_level(@_);
}
sub dec_level {
my ($self, $delta) = @_;
$delta ||= 1;
$self->level(Log::Log4perl::Level::get_lower_level($self->level(), $delta));
$self->set_output_methods;
}
which means that $logger->more_logging(0) actually decrements the log level by 1.