change log init to be entirely with in object::remote::logging
[scpubgit/Object-Remote.git] / lib / Object / Remote / Logging.pm
index 1c45b45..6446ebc 100644 (file)
@@ -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})};
@@ -105,14 +111,6 @@ sub init_logging {
   my $selections = $ENV{OBJECT_REMOTE_LOG_SELECTIONS};
   my %controller_should_log;
 
-  #TODO how can a third party module perform an action when a new
-  #interpreter is built on a remote node with out requiring support
-  #for that third party module baked into object::remote?
-  eval {
-    require Log::Any::Adapter;
-    Log::Any::Adapter->set('+Object::Remote::Logging::LogAnyInjector');
-  };
-
   return unless defined $level;
   $format = "[%l %r] %s" unless defined $format;
   $selections = __PACKAGE__ unless defined $selections;