Subject: | MooseX::Log::Log4perl::Easy methods should adjust $Log::Log4perl::caller_depth |
The MooseX::Log::Log4perl::Easy methods should adjust $Log::Log4perl::caller_depth. Without that, items like %M in a PatternLayout are wrong.
Also, there's no need for a temp variable, so the subs should look like this:
sub log_fatal { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->fatal(@_); }
sub log_error { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->error(@_); }
sub log_warn { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->warn(@_); }
sub log_info { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->info(@_); }
sub log_debug { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->debug(@_); }
sub log_trace { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; shift->logger->trace(@_); }