Class: Delayed::DelayedMerbLogger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/delayed/worker.rb

Instance Method Summary collapse

Constructor Details

#initializeDelayedMerbLogger

Returns a new instance of DelayedMerbLogger.



10
11
12
# File 'lib/delayed/worker.rb', line 10

def initialize
  @logger = Merb.logger
end

Instance Method Details

#add(level, message) ⇒ Object



16
17
18
# File 'lib/delayed/worker.rb', line 16

def add(level, message)
  self.__send__(choose_level(level), message)
end

#choose_level(level) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/delayed/worker.rb', line 20

def choose_level(level)
  case level
    when Logger::FATAL then :fatal
    when Logger::ERROR then :error
    when Logger::WARN then :warn
    when Logger::DEBUG then :debug
    else :info
  end
end