use Try::Tiny;
use System::Introspector::Report::Source;
use System::Introspector::Report::Config;
-use Log::Contextual qw( set_logger );
+use Log::Contextual qw( :log set_logger );
use Log::Contextual::SimpleLogger;
GetOptions(
set_logger $logger;
my $config = System::Introspector::Report::Config
- ->new(config_file => $config_file);
+ ->new(config_file => log_debug { "Loading config '$_[0]'" } $config_file);
my $source = System::Introspector::Report::Source
- ->new_from_root($storage_dir);
+ ->new_from_root(log_debug { "Loading storage '$_[0]'" } $storage_dir);
my @types = $all_reports
? $config->report_types
: map [$_, {}], @report_types;
+log_debug { "Generating report data" };
my @reports = $source->generate(@types);
+log_debug { "Publishing report data" };
for my $publisher ($config->publishers(@publish_types)) {
try {
$publisher->publish(\@reports);
print "Error during publish: $_\n";
};
}
+log_debug { "Done" };
__END__