From: Tyler Riddle <t.riddle@shadowcat.co.uk>
Date: Sat, 10 Nov 2012 20:27:16 +0000 (-0800)
Subject: start of object::remote logging usage
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a63da0bb99cf763e0a46649b620f25934eebfaf;p=scpubgit%2FSystem-Introspector-Report.git

start of object::remote logging usage
---

diff --git a/bin/system-introspector-report b/bin/system-introspector-report
index 66b52a7..2aa6c04 100755
--- a/bin/system-introspector-report
+++ b/bin/system-introspector-report
@@ -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
index 0000000..8f06c14
--- /dev/null
+++ b/lib/System/Introspector/Report/Logging.pm
@@ -0,0 +1,5 @@
+package System::Introspector::Report::Logging;
+
+use base qw(Object::Remote::Logging);
+
+1;