From: Arthur Axel 'fREW' Schmidt Date: Sat, 21 Jul 2012 03:35:31 +0000 (-0500) Subject: clarify exports and remove cruft X-Git-Tag: v0.004200~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4d67519d7408455c752823406617aaa2726510a;p=p5sagit%2FLog-Contextual.git clarify exports and remove cruft --- diff --git a/lib/Log/Contextual.pm b/lib/Log/Contextual.pm index 1cfa643..c070171 100644 --- a/lib/Log/Contextual.pm +++ b/lib/Log/Contextual.pm @@ -390,7 +390,7 @@ Import Tag: C<:log> Arguments: C -All of the following six functions work the same except that a different method +C functions all work the same except that a different method is called on the underlying C<$logger> object. The basic pattern is: sub log_$level (&@) { @@ -411,29 +411,24 @@ ways, but often it's convenient just for partial inspection of passthrough data If you want complete inspection of passthrough data, take a look at the L functions. -=head3 log_trace +Which functions are exported depends on what was passed to L. The +default (no C<-levels> option passed) would export: - log_trace { 'entered method foo with args ' join q{,}, @args }; +=over 2 -=head3 log_debug +=item log_trace - log_debug { 'entered method foo' }; +=item log_debug -=head3 log_info +=item log_info - log_info { 'started process foo' }; +=item log_warn -=head3 log_warn +=item log_error - log_warn { 'possible misconfiguration at line 10' }; +=item log_fatal -=head3 log_error - - log_error { 'non-numeric user input!' }; - -=head3 log_fatal - - log_fatal { '1 is never equal to 0!' }; +=back =head2 logS_$level @@ -472,29 +467,24 @@ and the output might look something like: "fRUE" "fiSMBoC" -=head3 Dlog_trace - - my ($foo, $bar) = Dlog_trace { "entered method foo with args: $_" } @_; - -=head3 Dlog_debug - - Dlog_debug { "random data structure: $_" } { foo => $bar }; +Which functions are exported depends on what was passed to L. The +default (no C<-levels> option passed) would export: -=head3 Dlog_info +=over 2 - return Dlog_info { "html from method returned: $_" } "..."; +=item Dlog_trace -=head3 Dlog_warn +=item Dlog_debug - Dlog_warn { "probably invalid value: $_" } $foo; +=item Dlog_info -=head3 Dlog_error +=item Dlog_warn - Dlog_error { "non-numeric user input! ($_)" } $port; +=item Dlog_error -=head3 Dlog_fatal +=item Dlog_fatal - Dlog_fatal { '1 is never equal to 0!' } 'ZOMG ZOMG' if 1 == 0; +=back =head2 DlogS_$level