Module: LogStasher::SilentLogger

Defined in:
lib/logstasher/silent_logger.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/logstasher/silent_logger.rb', line 3

def self.included(klass)
  klass.class_eval do
    def logger
      unless @logstasher_silent_logger
        @logstasher_silent_logger       = ::Logger.new('/dev/null')
        @logstasher_silent_logger.level = ::Logger::UNKNOWN
      end

      @logstasher_silent_logger
    end
  end
end