'File::Tree::Snapshot' => 0,
'Object::Remote' => 0,
'JSON::Diffable' => 0,
- 'Log::Contextual', => 0,
);
# have to do this since old EUMM dev releases miss the eval $VERSION line
}
my ($stderr_destination, $stdout_destination, $warn_destination);
+my $selector = sub { $_[0]->{package} =~ m/^System::Introspector/; };
-$warn_destination = Object::Remote::LogDestination->new({
- logger => System::Introspector::Logger::WarnOutput->new({
- levels_upto => 'warn',
- }),
-});
-
-$warn_destination->connect(System::Introspector::Logger->arg_router);
-
-$stdout_destination = Object::Remote::LogDestination->new(
- logger => System::Introspector::Logger::VerboseOutput->new({
- levels => ['info'],
- }),
-);
-
-$stdout_destination->connect(System::Introspector::Logger->arg_router);
-
+#suppress default output if a log level was specified
if (defined($log_level)) {
$stderr_destination = Object::Remote::LogDestination->new(
logger => System::Introspector::Logger::Output->new({
levels_upto => $log_level,
}),
- );
-
- $stderr_destination->connect(System::Introspector::Logger->arg_router);
+ )->select(System::Introspector::Logger->arg_router, $selector);
+
+} else {
+ $stdout_destination = Object::Remote::LogDestination->new(
+ logger => System::Introspector::Logger::VerboseOutput->new({
+ levels => ['info'],
+ }),
+ )->select(System::Introspector::Logger->arg_router, $selector);
+
+ $warn_destination = Object::Remote::LogDestination->new({
+ logger => System::Introspector::Logger::WarnOutput->new({
+ levels_upto => 'warn',
+ }),
+ })->select(System::Introspector::Logger->arg_router, $selector);
}
$config_file = "$storage_dir/main.conf" unless defined $config_file;
log_debug { "Using '$module' for this gather" };
my $module_name = use_module($module);
log_trace { "Finished loading '$module'; returned value was '$module_name'" };
- #my $instance = $module_name->new::on('-', $args);
my $instance = $module_name->new($args);
log_trace { "Finished constructing '$module_name'; starting gather" };
my $probe_data = $instance->gather;
log_trace { "Getting report data for probe name '$name'" };
my $data = $self->data->{$name};
return $data unless $self->tied_output;
- log_info { "Probe data is coming from tied objects" };
+ log_debug { "Probe data is coming from tied objects" };
return System::Introspector::Gatherer::Report::Hash->_anonymous_tie($data);
}