fixed old logging metadata name missed from previous update
[scpubgit/Object-Remote.git] / lib / Object / Remote / Logging.pm
index 4571c0a..15f4d97 100644 (file)
@@ -4,7 +4,6 @@ use Moo;
 use Scalar::Util qw(blessed);
 use Object::Remote::Logging::Logger;
 use Exporter::Declare;
-use Carp qw(carp croak);
 
 extends 'Log::Contextual';
 
@@ -106,16 +105,17 @@ sub init_logging {
   );
 
   router()->connect(sub { 
-    my $controller = $_[1]->{controller};
+    my $controller = $_[1]->{exporter};
     my $will_log = $controller_should_log{$controller};
+    my $remote_info = $_[1]->{object_remote};
     
     $will_log = $controller_should_log{'*'} unless defined $will_log;
     
     return unless $will_log;
     #skip things from remote hosts because they log to STDERR
     #when OBJECT_REMOTE_LOG_LEVEL is in effect
-    return if $_[1]->{remote}->{object_remote};
-    $logger
+    return if $remote_info->{forwarded};
+    return $logger;
   });
 }