[Catalyst] Should CATALYST_DEBUG suppress manual calls to $c->log->debug()?

Jonathan Rockway jon at jrock.us
Sat Aug 25 04:02:51 GMT 2007

Will Hawes wrote:
> Is my mistake in misunderstanding how $c->log->debug() is supposed to
> work? Or is it likely that I've somehow overridden CATALYST_DEBUG
> elsewhere?

It is indeed.  $c->log->debug() has nothing to do with CATALYST_DEBUG.  Try:

  $c->log->debug('Hello') if $c->debug;

I think the reason for this is so that if you have sub MyApp::debug { 0
}, the call to debug is completely optimized away at compile time... but
I'm not sure this works for method calls (or even MyApp->debug, although
MyApp::debug would work correctly).

Someone else will explain what's actually going on.  I've had too much
to drink tonight :)

Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070824/75ad=

More information about the Catalyst mailing list