[Catalyst] Problem with $c->log always on

Matt S Trout dbix-class at trout.me.uk
Tue Sep 12 20:08:21 CEST 2006


Nate Wiger wrote:
> It looks like $c->log is always on in a given Catalyst plugin. I have 
> simple, standard code like this:
> 
>     $c->log->debug("some message");
>     $c->log->debug(Dumper(\%hash)) if $c->log->is_debug;
> 
> When I dump out the $c->log->is*, all of them return true (actually, 
> 1/4/16 depending on the level, I assume this is a bitmask byproduct).
> 
> Any ideas? Anyone else seen this? I even double-checked my classes to 
> make sure they aren't overriding it...

Log level config is separate from debug mode.

__PACKAGE__->log(Catalyst::Log->new(@levels));

or

$c->log->debug(...) if $c->debug; # this is what the Cat internals do

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list