From: Tyler Riddle Date: Tue, 4 Sep 2012 23:50:30 +0000 (-0700) Subject: add deps to Makefile.PL ; update system-introspector script for logging support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1164b8ec0a92e9c921d7aaf55d4222f4f84da5c;p=scpubgit%2FSystem-Introspector.git add deps to Makefile.PL ; update system-introspector script for logging support --- diff --git a/Makefile.PL b/Makefile.PL index d9de16b..f593f2d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -28,6 +28,7 @@ my %requires = ( '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 diff --git a/bin/system-introspector b/bin/system-introspector index 68bda45..a0de0de 100755 --- a/bin/system-introspector +++ b/bin/system-introspector @@ -6,6 +6,9 @@ use Pod::Usage; use System::Introspector::State; use File::Tree::Snapshot; use System::Introspector::Config; +use System::Introspector::Logger qw( :log ); + +log_debug { "$0 started executing" }; GetOptions( 'c|config=s' => \my $config_file, @@ -24,12 +27,18 @@ die "Requires --config\n" die "Requires --all or --group option\n" unless $update_all or @update_groups; +log_trace { "Completed parsing command line options" }; + +$config_file = "$storage_dir/main.conf" unless defined $config_file; + +log_debug { "Configuration file: '$config_file'"; }; + my $config = System::Introspector::Config->new( - config_file => (defined($config_file) - ? $config_file - : "$storage_dir/main.conf"), + config_file => $config_file, ); +log_trace { "Completed building configuration" }; + $config->has_group($_) or die "Unknown group '$_'\n" for @update_groups; @@ -41,7 +50,11 @@ my $state = System::Introspector::State->new( root => $storage_dir, ); +log_trace { "Completed building introspector state" }; + +log_info { "Ready to start gathering results" }; $state->gather(@update_groups); +log_info { "Completed gathering results" }; __END__