On Mon, Jan 18, 2010 at 12:22 PM, Kiffin Gish <[email protected]> wrote: > I'd like to subclass $c->log->debug(message) so that it prints out: > > ''.$c->action.': '.'message' > > What's the easiest way to do this? >
Easiest is to just switch to Catalyst::Log::Log4perl, since it will do what you want out of the box. Something like this in your log4perl.conf would work: log4perl.rootLogger=DEBUG, SCREEN log4perl.appender.SCREEN = Log::Log4perl::Appender log4perl.appender.SCREEN.stderr = 1 log4perl.appender.SCREEN.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.SCREEN.layout.ConversionPattern = %d %p [%c : %L] %m%n That will give you a log like: 2010/01/12 13:54:40 DEBUG [Catalyst.View.TT : 1881] Rendering template "foo.tt" -J _______________________________________________ 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/
