From: Arthur Axel 'fREW' Schmidt Date: Sat, 20 Feb 2010 10:11:52 +0000 (-0600) Subject: rest of basic pod X-Git-Tag: v0.00100~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=83b33eb5ec9c07201f7b3cda3271a725d0df6f70;p=p5sagit%2FLog-Contextual.git rest of basic pod --- diff --git a/lib/Log/Contextual.pm b/lib/Log/Contextual.pm index aba348b..661210b 100644 --- a/lib/Log/Contextual.pm +++ b/lib/Log/Contextual.pm @@ -317,9 +317,9 @@ is called on the underlying C<$logger> object. The basic pattern is: =head2 Dlog_$level -Arguments: CodeRef $returning_message +Arguments: CodeRef $returning_message, @args -All of the following six functions work the same as their log_$level brethren, +All of the following six functions work the same as their L brethren, except they return what is passed into them and as a bonus put the stringified (with L) version of their args into C<$_>. This means you can do cool things like the following: @@ -358,6 +358,42 @@ and the output might look something like: Dlog_fatal { '1 is never equal to 0!' } 'ZOMG ZOMG' if 1 == 0; +=head2 DlogS_$level + +Arguments: CodeRef $returning_message, Item $arg + +All of the following six functions work the same as the related L +functions, except they only take a single scalar after the +C<$returning_message> instead of slurping up (and also setting C) +all the C<@args> + + my $pals_rs = DlogS_debug { "pals resultset: $_" } + $schema->resultset('Pals')->search({ perlers => 1 }); + +=head3 DlogS_trace + + my ($foo, $bar) = DlogS_trace { "entered method foo with first arg $_" } @_; + +=head3 DlogS_debug + + DlogS_debug { "random data structure: $_" } { foo => $bar }; + +=head3 DlogS_info + + return DlogS_info { "html from method returned: $_" } "..."; + +=head3 DlogS_warn + + DlogS_warn { "probably invalid value: $_" } $foo; + +=head3 DlogS_error + + DlogS_error { "non-numeric user input! ($_)" } $port; + +=head3 DlogS_fatal + + DlogS_fatal { '1 is never equal to 0!' } 'ZOMG ZOMG' if 1 == 0; + =head1 AUTHOR frew - Arthur Axel "fREW" Schmidt