From: Marcus Ramberg Date: Thu, 3 Nov 2005 16:15:52 +0000 (+0000) Subject: allow debug to be disabled via Env. X-Git-Tag: 5.7099_04~1037 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=59c2b3bd20a496dceafecff5e231e46af51e8a69 allow debug to be disabled via Env. --- diff --git a/Changes b/Changes index 4d0dce8..833dc14 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Tis file documents the revision history for Perl extension Catalyst. 5.50 + - Allow debug to be disabled via ENV as well as enabled. - Added -scripts option to catalyst.pl for script updating - Changed helpers to default to long types, Controller instead of C - Added Catalyst::Controller, Catalyst::Model and Catalyst::View diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 66dd7d3..01b9e8d 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1563,7 +1563,12 @@ sub setup_log { $class->log( Catalyst::Log->new ); } - if ( $ENV{CATALYST_DEBUG} || $ENV{ uc($class) . '_DEBUG' } || $debug ) { + + if ( $ENV{CATALYST_DEBUG} || + $ENV{ Catalyst::Utils->class2env($class) . '_DEBUG' } || + $debug && + $ENV{CATALYST_DEBUG} != 0 && + $ENV{ Catalyst::Utils->class2env($class).'_DEBUG' } != 0 ) { no strict 'refs'; *{"$class\::debug"} = sub { 1 }; $class->log->debug('Debug messages enabled');