my $level = $ENV{OBJECT_REMOTE_LOG_LEVEL};
my $format = $ENV{OBJECT_REMOTE_LOG_FORMAT};
my $selections = $ENV{OBJECT_REMOTE_LOG_SELECTIONS};
+ my $test_logging = $ENV{OBJECT_REMOTE_TEST_LOGGER};
my %controller_should_log;
unless (defined $ENV{OBJECT_REMOTE_LOG_FORWARDING} && $ENV{OBJECT_REMOTE_LOG_FORWARDING} ne '') {
$ENV{OBJECT_REMOTE_LOG_FORWARDING} = 1;
}
+
+ if ($test_logging) {
+ require Object::Remote::Logging::TestLogger;
+ router->connect(Object::Remote::Logging::TestOutput->new(
+ min_level => 'trace', max_level => 'error',
+ level_names => Object::Remote::Logging->arg_levels(),
+ ));
+ }
return unless defined $level && $level ne '';
$format = "[%l %r] %s" unless defined $format;
--- /dev/null
+package Object::Remote::Logging::TestOutput;
+
+use base qw ( Object::Remote::Logging::Logger );
+
+#don't need to output anything
+sub _output { }
+
+1;
use Test::Fatal;
use FindBin;
use lib "$FindBin::Bin/lib";
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote;
use Object::Remote::Future qw( await_all await_future );
use Test::More;
use Sys::Hostname qw(hostname);
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote;
use Test::More;
use Sys::Hostname qw(hostname);
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote::FromData;
use lib "$FindBin::Bin/lib";
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote;
use Data::Dumper;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote::Connector::Local;
use Object::Remote::Connector::SSH;
use strictures 1;
use Test::More;
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
+
use Object::Remote;
use Object::Remote::FromData;
sub ping {
return 'pong';
-}
\ No newline at end of file
+}
use strictures 1;
use Test::More;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote::Connector::Local;
use Object::Remote;
use Object::Remote;
use File::Spec;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
{
package S1S;
use Tie::Array;
use Tie::Hash;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote;
use ORTestTiedRemote;
use strictures 1;
use Test::More;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote;
use Object::Remote::Connector::Local;
use Test::Fatal;
use FindBin;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
$ENV{PERL5LIB} = join(
':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib t/lib)
use strictures 1;
use Test::More;
-require 't/logsetup.pl';
+$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
use Object::Remote::Connector::Local;