From: Tyler Riddle Date: Sun, 11 Nov 2012 01:17:43 +0000 (-0800) Subject: change log init to be entirely with in object::remote::logging X-Git-Tag: v0.003001_01~65 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2a695379d7eb1d6907feb002e3de0ea37c9536b;p=scpubgit%2FObject-Remote.git change log init to be entirely with in object::remote::logging --- diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 03095a5..e281117 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -7,10 +7,6 @@ use Module::Runtime qw(use_module); our $VERSION = '0.002003'; # 0.2.3 -BEGIN { - Object::Remote::Logging->init_logging; -} - sub new::on { my ($class, $on, @args) = @_; my $conn = __PACKAGE__->connect($on); diff --git a/lib/Object/Remote/Logging.pm b/lib/Object/Remote/Logging.pm index 840458b..6446ebc 100644 --- a/lib/Object/Remote/Logging.pm +++ b/lib/Object/Remote/Logging.pm @@ -39,7 +39,13 @@ sub arg_levels { sub before_import { my ($class, $importer, $spec) = @_; my $router = $class->router; + our $DID_INIT; + unless($DID_INIT) { + $DID_INIT = 1; + init_logging(); + } + $class->SUPER::before_import($importer, $spec); my @levels = @{$class->arg_levels($spec->config->{levels})};