NullLogger for Category support
Arthur Axel 'fREW' Schmidt [Mon, 13 Sep 2010 04:51:22 +0000 (23:51 -0500)]
lib/Log/Contextual/NullLogger.pm [new file with mode: 0644]

diff --git a/lib/Log/Contextual/NullLogger.pm b/lib/Log/Contextual/NullLogger.pm
new file mode 100644 (file)
index 0000000..1cf41d5
--- /dev/null
@@ -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;
+