From: Arthur Axel 'fREW' Schmidt Date: Sun, 21 Feb 2010 03:34:13 +0000 (-0600) Subject: method reorg X-Git-Tag: v0.00100~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4273dbf7cfc7c98377278358bdb18df9e4a06de;p=p5sagit%2FLog-Contextual.git method reorg --- diff --git a/lib/Log/Contextual.pm b/lib/Log/Contextual.pm index 79ecda8..b472e91 100644 --- a/lib/Log/Contextual.pm +++ b/lib/Log/Contextual.pm @@ -71,6 +71,8 @@ sub with_logger { $_[1]->(); } + + sub log_trace (&@) { my $log = $Get_Logger->(); my $code = shift; @@ -129,6 +131,48 @@ sub Dlog_trace (&@) { } @values } +sub Dlog_debug (&@) { + my $code = shift; + my @values = @_; + log_debug { + do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; + } @values +} + +sub Dlog_info (&@) { + my $code = shift; + my @values = @_; + log_info { + do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; + } @values +} + +sub Dlog_warn (&@) { + my $code = shift; + my @values = @_; + log_warn { + do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; + } @values +} + +sub Dlog_error (&@) { + my $code = shift; + my @values = @_; + log_error { + do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; + } @values +} + +sub Dlog_fatal (&@) { + my $code = shift; + my @values = @_; + log_fatal { + do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; + } @values +} + + + sub DlogS_trace (&$) { my $code = $_[0]; my $value = $_[1]; @@ -138,14 +182,6 @@ sub DlogS_trace (&$) { $value } -sub Dlog_debug (&@) { - my $code = shift; - my @values = @_; - log_debug { - do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; - } @values -} - sub DlogS_debug (&$) { my $code = $_[0]; my $value = $_[1]; @@ -155,14 +191,6 @@ sub DlogS_debug (&$) { $value } -sub Dlog_info (&@) { - my $code = shift; - my @values = @_; - log_info { - do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; - } @values -} - sub DlogS_info (&$) { my $code = $_[0]; my $value = $_[1]; @@ -172,14 +200,6 @@ sub DlogS_info (&$) { $value } -sub Dlog_warn (&@) { - my $code = shift; - my @values = @_; - log_warn { - do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; - } @values -} - sub DlogS_warn (&$) { my $code = $_[0]; my $value = $_[1]; @@ -189,14 +209,6 @@ sub DlogS_warn (&$) { $value } -sub Dlog_error (&@) { - my $code = shift; - my @values = @_; - log_error { - do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; - } @values -} - sub DlogS_error (&$) { my $code = $_[0]; my $value = $_[1]; @@ -206,14 +218,6 @@ sub DlogS_error (&$) { $value } -sub Dlog_fatal (&@) { - my $code = shift; - my @values = @_; - log_fatal { - do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() }; - } @values -} - sub DlogS_fatal (&$) { my $code = $_[0]; my $value = $_[1];