We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3d0916 commit af3e2d5Copy full SHA for af3e2d5
lib/grim/null_logger.rb
@@ -1,4 +1,11 @@
1
+require "logger"
2
+
3
module Grim
- class NullLogger
4
+ class NullLogger < ::Logger
5
+ def initialize(*args)
6
+ end
7
8
+ def add(*args, &block)
9
10
end
11
spec/lib/grim/null_logger_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+require "stringio"
+describe Grim::NullLogger do
+ it "acts like Logger but doesn't log anything" do
+ io = StringIO.new
+ logger = Grim::NullLogger.new(io)
+ logger.debug "hello world"
+ expect(io.string).to eq("")
+end
0 commit comments