From: Tyler Riddle Date: Fri, 14 Sep 2012 01:31:17 +0000 (-0700) Subject: give system::introspector a unique log router X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=604a08d7c174af7e37f4bd47bababddce165fd8f;p=scpubgit%2FSystem-Introspector.git give system::introspector a unique log router --- diff --git a/bin/system-introspector b/bin/system-introspector index d3552ff..63f5c9e 100755 --- a/bin/system-introspector +++ b/bin/system-introspector @@ -43,10 +43,7 @@ if (defined($log_level)) { ); $log_destination->connect(System::Introspector::Logger->arg_router); - #$log_destination->connect(Object::Remote::Logging->arg_router); - #TODO attaching to this router does't work here because of - #timming issue - #$log_destination->connect(Object::Remote::Logging->get_router); + $log_destination->connect(Object::Remote::Logging->arg_router); } $config_file = "$storage_dir/main.conf" unless defined $config_file; diff --git a/lib/System/Introspector/Logger.pm b/lib/System/Introspector/Logger.pm index fa50436..47c0833 100644 --- a/lib/System/Introspector/Logger.pm +++ b/lib/System/Introspector/Logger.pm @@ -8,6 +8,8 @@ use Object::Remote::LogDestination; use base qw(Object::Remote::Logging); +sub arg_router { return $_[1] if defined $_[1]; our $Router_Instance ||= Object::Remote::LogRouter->new } + #should always pass in log level and execution context; #specifying a logger is used when logging during #testing so a null output logging class can be used