[Catalyst] debug mode or debug levels?

Matt Lawrence matt.lawrence at ymogen.net
Wed Mar 5 10:59:17 GMT 2008


Bill Moseley wrote:
> On Tue, Mar 04, 2008 at 05:22:38PM +0000, Matt Lawrence wrote:
>   
>> Tyler Bird wrote:
>>     
>>> hi I want to only show certain log messages to my console based on the 
>>> log level 'debug'
>>> I believe catalyst supports log levels, but this doesn't seem to be 
>>> working
>>>
>>>
>>> if ( $c->is_debug() )
>>> {
>>>   $c->log("log message here..");
>>> }
>>>
>>>
>>>       
>> I believe that's spelt:
>>
>> if ($c->log->is_debug) {
>>    $c->log->debug("log message here..");
>> }
>>     
>
> Isn't that the same thing as simply:
>
>     $c->log->debug('log message here...');
>   

Quite right, I was imagining the OP was going to do more heavy-duty 
debugging for which the sample code was a test case.

>
> There's also:
>
>     $c->log->debug('message') if $c->debug;
>
> which, IIRC, is set true if CATALYST_DEBUG is true (or, of course, if
> you create a sub debug {1} in your app).
>   
You can also use MYAPP_DEBUG to set debugging on an app-by-app basis.

Matt




More information about the Catalyst mailing list