From: Robert 'phaylon' Sedlacek Date: Wed, 3 Oct 2012 19:47:14 +0000 (+0000) Subject: give modules default loggers so they are usable on their own (in tests) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=55dfa20f8cbc4448a03b349c43a8f42b7c3aeb45;hp=a0c9420e77d1b8c49b8edfa0513bfa15148574a8;p=scpubgit%2FSystem-Introspector-Report.git give modules default loggers so they are usable on their own (in tests) --- diff --git a/lib/System/Introspector/Report/Publish/MediaWiki.pm b/lib/System/Introspector/Report/Publish/MediaWiki.pm index 2d4186a..768a465 100644 --- a/lib/System/Introspector/Report/Publish/MediaWiki.pm +++ b/lib/System/Introspector/Report/Publish/MediaWiki.pm @@ -1,7 +1,13 @@ package System::Introspector::Report::Publish::MediaWiki; use Moo; use Try::Tiny; -use Log::Contextual qw( :log ); +use Log::Contextual::WarnLogger; +use Log::Contextual qw( :log ), + -default_logger => Log::Contextual::WarnLogger->new({ + env_prefix => 'SI_REPORT_MEDIAWIKI', + levels => [qw( error fatal warn )], + }); + use aliased 'System::Introspector::Report::Publish::MediaWiki::Connection'; has page_options => ( diff --git a/lib/System/Introspector/Report/Source.pm b/lib/System/Introspector/Report/Source.pm index 7373df9..1af1efb 100644 --- a/lib/System/Introspector/Report/Source.pm +++ b/lib/System/Introspector/Report/Source.pm @@ -3,7 +3,12 @@ use Moo; use JSON::PP; use IO::All; use Module::Runtime qw( use_module ); -use Log::Contextual qw( :log ); +use Log::Contextual::WarnLogger; +use Log::Contextual qw( :log ), + -default_logger => Log::Contextual::WarnLogger->new({ + env_prefix => 'SI_REPORT_SOURCE', + levels => [qw( error fatal warn )], + }); my $_json = JSON::PP->new->utf8->relaxed->allow_nonref;