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...'); 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). In other words, it's possible to have $c->debug be different from $c->log->is_debug. That's helpful as you can have $c->log->debug messages display but not have all the catalyst-generated debug messages display because they often written, for example, as: $c->log->debug(qq/"$method" request for "$path" from "$address"/) if $c->debug; Before calling setup I often do something like: $self->log( Catalyst::Log->new( @log_levels ) ); Where @log_levels can be set via an environment variable. But that will break the ability to "use Catalyst '-Debug'" or -LOG=warn. -- Bill Moseley [EMAIL PROTECTED] _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/