Skip Menu |

This queue is for tickets about the MooseX-Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 45554
Status: resolved
Priority: 0/
Queue: MooseX-Log-Log4perl

People
Owner: Nobody in particular
Requestors: TIMB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



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(@_); }
Subject: Re: [rt.cpan.org #45554] MooseX::Log::Log4perl::Easy methods should adjust $Log::Log4perl::caller_depth
Date: Tue, 12 May 2009 08:41:52 +0200
To: bug-MooseX-Log-Log4perl [...] rt.cpan.org
From: Roland Lammel <lammel [...] cpan.org>
Ooops, overlooked your mail. Thanks for reporting, MooseX::Log::Log4perl will get some love soon, where I'll incorporate your proposed changes. Cheers +rl On Wed, Apr 29, 2009 at 13:10, Tim_Bunce via RT < bug-MooseX-Log-Log4perl@rt.cpan.org> wrote: Show quoted text
> Wed Apr 29 07:10:34 2009: Request 45554 was acted upon. > Transaction: Ticket created by TIMB > Queue: MooseX-Log-Log4perl > Subject: MooseX::Log::Log4perl::Easy methods should adjust > $Log::Log4perl::caller_depth > Broken in: (no value) > Severity: Critical > Owner: Nobody > Requestors: TIMB@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=45554 > > > > 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(@_); }
-- Roland Lammel QuikIT - IT Lösungen - flexibel und schnell Web: http://www.quikit.at Email: info@quikit.at "Enjoy your job, make lots of money, work within the law. Choose any two."
Resolved (and tests added) in 0.40 of MooseX::Log::Log4perl finding it's way to CPAN soon.