[Catalyst] Using Log4perl -- setting caller()

Bill Moseley moseley at hank.org
Wed Jul 4 07:23:43 GMT 2007


On Tue, Jul 03, 2007 at 03:14:52PM -0700, Quinn Weaver wrote:
> > Now, the problem with that is $c->log->warn uses caller() so errors
> > are reported from that sub, not from where warn was called.  So, need
> > a way to use (IIRC) caller(1) instead in that case.
> 
> Talked to Bill off-list, and this problem appears to be spurious.
> That is, the messages are actually reported as coming from the right line,
> after all.

No, that's something different.  Full stack traces look fine.

It's %M and the other formats mentioned in the docs that won't be
right.  The plugin uses caller, so obviously calling $c->log->warn
will look different than calling warn (when is trapped and then calls
$c->log->warn as in the code I posted).

Print out %M and call both $c->log->warn and warn() and you will see the
issue.



-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list