start of object::remote logging usage
Tyler Riddle [Sat, 10 Nov 2012 20:27:16 +0000 (12:27 -0800)]
bin/system-introspector-report
lib/System/Introspector/Report/Logging.pm [new file with mode: 0644]

index 66b52a7..2aa6c04 100755 (executable)
@@ -5,8 +5,7 @@ use Pod::Usage;
 use Try::Tiny;
 use System::Introspector::Report::Source;
 use System::Introspector::Report::Config;
-use Log::Contextual                         qw( :log set_logger );
-use Log::Contextual::SimpleLogger;
+use System::Introspector::Report::Logging qw( :log router );
 
 GetOptions(
   's|storage=s' => \my $storage_dir,
@@ -24,16 +23,6 @@ die "$0 requires --storage (-s) to be specified\n"
 die "$0 requires --config (-c) to be specified\n"
   unless defined $config_file;
 
-my @additional_log_levels = qw( debug trace );
-my $logger = Log::Contextual::SimpleLogger->new({
-  levels => [
-    qw( error fatal warn info ),
-    grep { defined }
-      @additional_log_levels[0 .. (($log_verbose || 0) - 1)],
-  ],
-});
-set_logger $logger;
-
 my $timed = sub { sprintf shift, scalar localtime };
 
 log_info { 'Starting at %s'->$timed };
diff --git a/lib/System/Introspector/Report/Logging.pm b/lib/System/Introspector/Report/Logging.pm
new file mode 100644 (file)
index 0000000..8f06c14
--- /dev/null
@@ -0,0 +1,5 @@
+package System::Introspector::Report::Logging;
+
+use base qw(Object::Remote::Logging);
+
+1;