[Catalyst] Selective debug output
Jason Kohles
email at jasonkohles.com
Tue Nov 13 21:22:03 GMT 2007
On Nov 6, 2007, at 6:59 PM, Joe Landman wrote:
> How do I selectively enable or disable debugging output?
> Specifically, FormBuilder debugging output is simply far to verbose
> to be meaningful to us. I suppose I could simply pass in a debug=>0
> when I create the form. Is there any global way?
>
> FWIW: I only want to surpress formbuilder output during debug.
>
Log4perl and Catalyst::Log::Log4perl make this trivial, here is a bit
of the configuration from my log4perl.conf...
# Set the default to get everything at level DEBUG or above, and
output to the appender named Screen
log4perl.logger=DEBUG,Screen
# For Catalyst::Plugin::Authorization and subclasses, only log at
level ERROR or above
log4perl.logger.Catalyst.Plugin.Authorization=ERROR,Screen
# Same for Catalyst::Plugin::Session
log4perl.logger.Catalyst.Plugin.Session=ERROR,Screen
# Define a logger called Screen that logs to stderr, and that color
codes the output by level
log4perl.appender.Screen=Log::Log4perl::Appender::ScreenColoredLevels
log4perl.appender.Screen.stderr=1
log4perl.appender.Screen.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.Screen.layout.ConversionPattern=%p[%c] %m%n
--
Jason Kohles, RHCA RHCDS RHCE
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
More information about the Catalyst
mailing list