From: Arthur Axel 'fREW' Schmidt Date: Mon, 13 Sep 2010 04:51:22 +0000 (-0500) Subject: NullLogger for Category support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b03d1bdbc25e01c025726852ffb0405ff27cbd10;p=p5sagit%2FLog-Contextual.git NullLogger for Category support --- diff --git a/lib/Log/Contextual/NullLogger.pm b/lib/Log/Contextual/NullLogger.pm new file mode 100644 index 0000000..1cf41d5 --- /dev/null +++ b/lib/Log/Contextual/NullLogger.pm @@ -0,0 +1,23 @@ +package Log::Contextual::NullLogger; + +use strict; +use warnings; + +{ + for my $name (qw( trace debug info warn error fatal )) { + + no strict 'refs'; + + *{$name} = sub {}; + + *{"is_$name"} = sub { 0 }; + } +} + +sub new { + my ($class, $args) = @_; + bless {}, $class; +} + +1; +