}
sub _parse_selections {
- my ($selections_string) = @_;
- my %log_ok;
+ my ($selections_string) = @_;
+ my %log_ok;
- #example string:
- #" * -Object::Remote::Logging Foo::Bar::Baz "
- foreach(split(/\s+/, $selections_string)) {
- next if $_ eq '';
- if ($_ eq '*') {
- $log_ok{$_} = 1;
- } elsif (s/^-//) {
- $log_ok{$_} = 0;
- } else {
- $log_ok{$_} = 1;
- }
+ #example string:
+ #" * -Object::Remote::Logging Foo::Bar::Baz "
+ foreach(split(/\s+/, $selections_string)) {
+ next if $_ eq '';
+ if ($_ eq '*') {
+ $log_ok{$_} = 1;
+ } elsif (s/^-//) {
+ $log_ok{$_} = 0;
+ } else {
+ $log_ok{$_} = 1;
}
+ }
- return %log_ok;
+ return %log_ok;
}
#this is invoked on all nodes
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;