summary refs log tree commit
path: root/lib/rack/nulllogger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/nulllogger.rb')
-rw-r--r--lib/rack/nulllogger.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/rack/nulllogger.rb b/lib/rack/nulllogger.rb
new file mode 100644
index 00000000..77fb637d
--- /dev/null
+++ b/lib/rack/nulllogger.rb
@@ -0,0 +1,18 @@
+module Rack
+  class NullLogger
+    def initialize(app)
+      @app = app
+    end
+
+    def call(env)
+      env['rack.logger'] = self
+      @app.call(env)
+    end
+
+    def info(progname = nil, &block);  end
+    def debug(progname = nil, &block); end
+    def warn(progname = nil, &block);  end
+    def error(progname = nil, &block); end
+    def fatal(progname = nil, &block); end
+  end
+end