From: Tyler Riddle Date: Sat, 8 Dec 2012 03:08:25 +0000 (-0800) Subject: fix init order issue in logging X-Git-Tag: v0.003001_01~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6a523990ec85a485c742131ad1e0b5f77854e12;p=scpubgit%2FObject-Remote.git fix init order issue in logging --- diff --git a/lib/Object/Remote/Logging.pm b/lib/Object/Remote/Logging.pm index 6e74019..1095158 100644 --- a/lib/Object/Remote/Logging.pm +++ b/lib/Object/Remote/Logging.pm @@ -85,11 +85,6 @@ sub init_logging { )); } - return unless defined $level && $level ne ''; - $format = "[%l %r] %s" unless defined $format; - $selections = __PACKAGE__ unless defined $selections; - %controller_should_log = _parse_selections($selections); - { no warnings 'once'; if (defined $Object::Remote::FatNode::REMOTE_NODE) { @@ -99,6 +94,12 @@ sub init_logging { } } + return unless defined $level && $level ne ''; + + $format = "[%l %r] %s" unless defined $format; + $selections = __PACKAGE__ unless defined $selections; + %controller_should_log = _parse_selections($selections); + my $logger = Object::Remote::Logging::Logger->new( min_level => lc($level), format => $format, level_names => Object::Remote::Logging::arg_levels(),