From: Arthur Axel 'fREW' Schmidt Date: Wed, 3 Mar 2010 04:00:39 +0000 (-0600) Subject: add doc for -default_logger X-Git-Tag: v0.00200~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c154d18a4b1921fcc5f7ea6033f49f9cf113203a;p=p5sagit%2FLog-Contextual.git add doc for -default_logger --- diff --git a/lib/Log/Contextual.pm b/lib/Log/Contextual.pm index 596c155..d129cdb 100644 --- a/lib/Log/Contextual.pm +++ b/lib/Log/Contextual.pm @@ -382,6 +382,8 @@ overly complicated, take a look at L. =head1 OPTIONS +=head2 -logger + When you import this module you may use C<-logger> as a shortcut for L, for example: @@ -396,6 +398,23 @@ case you might try something like the following: BEGIN { $var_log = VarLogger->new } use Log::Contextual qw( :dlog ), -logger => $var_log; +=head2 -default_logger + +The C<-default_logger> import option is similar to the C<-logger> import option +except C<-default_logger> sets the the default logger for the current package. + +Basically it sets the logger to be used if C is never called; so + + package My::Package; + use Log::Contextual::SimpleLogger; + use Log::Contextual qw( :log ), + -default_logger => Log::Contextual::WarnLogger->new({ + env_var => 'MY_PACKAGE' + }); + +If you are interested in using this package for a module you are putting on +CPAN we recommend L for your default logger. + =head1 A WORK IN PROGRESS This module is certainly not complete, but we will not break the interface