X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FLogging.pm;h=1075016900a4b562cd719b31eaee916d8744c551;hp=10951582cf74bcc9bcdfa32b169308bd2cbd0347;hb=572a9a00cec239943f92157ec39c44398aad137f;hpb=f6a523990ec85a485c742131ad1e0b5f77854e12 diff --git a/lib/Object/Remote/Logging.pm b/lib/Object/Remote/Logging.pm index 1095158..1075016 100644 --- a/lib/Object/Remote/Logging.pm +++ b/lib/Object/Remote/Logging.pm @@ -74,7 +74,7 @@ sub init_logging { my %controller_should_log; unless (defined $ENV{OBJECT_REMOTE_LOG_FORWARDING} && $ENV{OBJECT_REMOTE_LOG_FORWARDING} ne '') { - $ENV{OBJECT_REMOTE_LOG_FORWARDING} = 1; + $ENV{OBJECT_REMOTE_LOG_FORWARDING} = 0; } if ($test_logging) { @@ -108,14 +108,15 @@ sub init_logging { router()->connect(sub { my $controller = $_[1]->{controller}; 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}->{connection_id}; - $logger + return if $remote_info->{forwarded}; + return $logger; }); } @@ -206,8 +207,8 @@ remote interpreter and the logger for the message is invoked in the local interp Sub-classes of Object::Remote::Logging will have log messages forwarded automatically. Loggers receive forwarded log messages exactly the same way as non-forwarded messages except a forwarded message includes extra metadata about the remote interpreter. Log -forwarding is enabled by default but comes with a performance hit; to disable it set the -OBJECT_REMOTE_LOG_FORWARDING environment variable to 0. See L. +forwarding is disabled by default because it comes with a performance hit; to enable +it set the OBJECT_REMOTE_LOG_FORWARDING environment variable to 1. =head1 EXPORTABLE SUBROUTINES