update logging support for log-contextual and object-remote changes
Tyler Riddle [Fri, 14 Sep 2012 00:09:16 +0000 (17:09 -0700)]
bin/system-introspector
lib/System/Introspector/Logger.pm
t/logger.t
t/logsetup.pl

index ece49c7..d3552ff 100755 (executable)
@@ -38,13 +38,12 @@ if (defined($debug) && ! defined($log_level)) {
 
 my $log_destination; 
 if (defined($log_level)) {
-warn "$log_level";
        $log_destination = Log::Contextual::Destination->new(
                logger => Log::Contextual::SimpleLogger->new({ levels_upto => $log_level }),
        );      
        
-    $log_destination->connect(System::Introspector::Logger->get_router);
-    #$log_destination->connect(Log::Contextual->get_root_router);
+    $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);
index fd460a4..fa50436 100644 (file)
@@ -1,13 +1,12 @@
-use strictures 1; 
-
 package System::Introspector::Logger;
 
-use base qw(Log::Contextual);
+use strictures 1;
+
 use System::Introspector::Logger::Output;
-use Log::Contextual qw( :log );
-use Log::Contextual::Destination;
+use Object::Remote::Logging qw( :log );
+use Object::Remote::LogDestination;
 
-sub arg_router { $_[1] || Log::Contextual::Router::Dynamic->new }
+use base qw(Object::Remote::Logging);
 
 #should always pass in log level and execution context;
 #specifying a logger is used when logging during
index b01720c..166f0e9 100644 (file)
@@ -3,6 +3,6 @@ use Test::More;
 
 use System::Introspector::Logger qw ( :log );
 
-ok (System::Introspector::Logger->get_router->does('Log::Contextual::Role::Router'), 'router exists');
+ok (System::Introspector::Logger->arg_router->does('Log::Contextual::Role::Router'), 'router exists');
 
 done_testing;
\ No newline at end of file
index 75de5e7..01c6df7 100644 (file)
@@ -12,14 +12,14 @@ sub _log {  }
 
 package main; 
 
-use System::Introspector::Logger qw( :log );
+use Object::Remote::Logging qw( :log ); 
+use Object::Remote::LogDestination; 
 #make sure to enable execution of every logging code block
 #by setting the log level as high as it can go
-       my $____LOG_DESTINATION = Log::Contextual::Destination->new(
+       my $____LOG_DESTINATION = Object::Remote::LogDestination->new(
                logger => System::Introspector::Logger::TestOutput->new({ levels_upto => 'trace' }),
        );      
        
-       $____LOG_DESTINATION->connect(System::Introspector::Logger->get_root_router);
-
+       $____LOG_DESTINATION->connect(Object::Remote::Logging->arg_router);
 1;