X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-DeploymentHandler.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FLogger.pm;fp=lib%2FDBIx%2FClass%2FDeploymentHandler%2FLogger.pm;h=811271743988595224af74d7329d77802855fe10;hp=0000000000000000000000000000000000000000;hb=4355e4fb0c11c32c5fa81cf2428203bd6640f024;hpb=e0e568cb03b832d4f2879cebb6e4972dec5f5300 diff --git a/lib/DBIx/Class/DeploymentHandler/Logger.pm b/lib/DBIx/Class/DeploymentHandler/Logger.pm new file mode 100644 index 0000000..8112717 --- /dev/null +++ b/lib/DBIx/Class/DeploymentHandler/Logger.pm @@ -0,0 +1,32 @@ +package DBIx::Class::DeploymentHandler::Logger; + +use warnings; +use strict; + +use parent 'Log::Contextual::WarnLogger'; + +# trace works the way we want it already + +# sub is_trace { $_[0]->next::method } +sub is_debug { $_[0]->is_trace || $_[0]->next::method } +sub is_info { $_[0]->is_debug || $_[0]->next::method } + +sub is_warn { + my $orig = $_[0]->next::method; + return undef if defined $orig && !$orig; + return $_[0]->is_info || 1 +} + +sub is_error { + my $orig = $_[0]->next::method; + return undef if defined $orig && !$orig; + return $_[0]->is_warn || 1 +} + +sub is_fatal { + my $orig = $_[0]->next::method; + return undef if defined $orig && !$orig; + return $_[0]->is_error || 1 +} + +1;