Class: Geocoder::KernelLogger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/geocoder/kernel_logger.rb

Instance Method Summary collapse

Instance Method Details

#add(level, message) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/geocoder/kernel_logger.rb', line 5

def add(level, message)
  return unless log_message_at_level?(level)
  case level
    when ::Logger::DEBUG, ::Logger::INFO
      puts message
    when ::Logger::WARN
      warn message
    when ::Logger::ERROR
      raise message
    when ::Logger::FATAL
      fail message
  end
end