$Get_Logger = $_[0];
}
+sub log_trace (&) {
+ my $log = $Get_Logger->();
+ $log->trace($_[0]->())
+ if $log->is_trace;
+}
+
sub log_debug (&) {
my $log = $Get_Logger->();
$log->debug($_[0]->())
if $log->is_debug;
}
+sub log_info (&) {
+ my $log = $Get_Logger->();
+ $log->info($_[0]->())
+ if $log->is_info;
+}
+
+sub log_warn (&) {
+ my $log = $Get_Logger->();
+ $log->warn($_[0]->())
+ if $log->is_warn;
+}
+
+sub log_error (&) {
+ my $log = $Get_Logger->();
+ $log->error($_[0]->())
+ if $log->is_error;
+}
+
+sub log_fatal (&) {
+ my $log = $Get_Logger->();
+ $log->fatal($_[0]->())
+ if $log->is_fatal;
+}
+
sub with_logger (&$) {
local $Get_Logger = $_[1];
$_[0]->();
use Data::Dumper::Concise;
use Log::Contextual ();
+sub Dlog_trace (&@) {
+ my $code = shift;
+ my @values = @_;
+ Log::Contextual::log_trace {
+ do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() };
+ };
+ @values
+}
+
+sub DlogS_trace (&$) {
+ my $code = $_[0];
+ my $value = $_[1];
+ Log::Contextual::log_trace {
+ do { local $_ = Data::Dumper::Concise::Dumper $value; $code->() };
+ };
+ $value
+}
+
sub Dlog_debug (&@) {
my $code = shift;
my @values = @_;
$value
}
+sub Dlog_info (&@) {
+ my $code = shift;
+ my @values = @_;
+ Log::Contextual::log_info {
+ do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() };
+ };
+ @values
+}
+
+sub DlogS_info (&$) {
+ my $code = $_[0];
+ my $value = $_[1];
+ Log::Contextual::log_info {
+ do { local $_ = Data::Dumper::Concise::Dumper $value; $code->() };
+ };
+ $value
+}
+
+sub Dlog_warn (&@) {
+ my $code = shift;
+ my @values = @_;
+ Log::Contextual::log_warn {
+ do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() };
+ };
+ @values
+}
+
+sub DlogS_warn (&$) {
+ my $code = $_[0];
+ my $value = $_[1];
+ Log::Contextual::log_warn {
+ do { local $_ = Data::Dumper::Concise::Dumper $value; $code->() };
+ };
+ $value
+}
+
+sub Dlog_error (&@) {
+ my $code = shift;
+ my @values = @_;
+ Log::Contextual::log_error {
+ do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() };
+ };
+ @values
+}
+
+sub DlogS_error (&$) {
+ my $code = $_[0];
+ my $value = $_[1];
+ Log::Contextual::log_error {
+ do { local $_ = Data::Dumper::Concise::Dumper $value; $code->() };
+ };
+ $value
+}
+
+sub Dlog_fatal (&@) {
+ my $code = shift;
+ my @values = @_;
+ Log::Contextual::log_fatal {
+ do { local $_ = Data::Dumper::Concise::Dumper @values; $code->() };
+ };
+ @values
+}
+
+sub DlogS_fatal (&$) {
+ my $code = $_[0];
+ my $value = $_[1];
+ Log::Contextual::log_fatal {
+ do { local $_ = Data::Dumper::Concise::Dumper $value; $code->() };
+ };
+ $value
+}
+
1;