From: Arthur Axel 'fREW' Schmidt Date: Fri, 20 Jul 2012 02:48:49 +0000 (-0500) Subject: slightly more clear docs X-Git-Tag: v0.004200~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9bf084b5a56175f77f34289be2135aae44fe7fa;p=p5sagit%2FLog-Contextual.git slightly more clear docs --- diff --git a/lib/Log/Contextual.pm b/lib/Log/Contextual.pm index 3cd4405..5b43622 100644 --- a/lib/Log/Contextual.pm +++ b/lib/Log/Contextual.pm @@ -194,14 +194,17 @@ Log::Contextual - Simple logging interface with a contextual log log_debug { 'program started' }; sub foo { - with_logger(Log::Contextual::SimpleLogger->new({ - levels => [qw( trace debug )] - }) => sub { + + my $minilogger = Log::Contextual::SimpleLogger->new({ + levels => [qw( trace debug )] + }); + + with_logger $minilogger => sub { log_trace { 'foo entered' }; my ($foo, $bar) = Dlog_trace { "params for foo: $_" } @_; # ... log_trace { 'foo left' }; - }); + }; } foo();