give modules default loggers so they are usable on their own (in tests)
[scpubgit/System-Introspector-Report.git] / lib / System / Introspector / Report / Source.pm
index 7373df9..1af1efb 100644 (file)
@@ -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;