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
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/