Class: DHC::Logger

Inherits:
Logger
  • Object
show all
Extended by:
Forwardable
Includes:
ActiveSupport::Configurable, Singleton
Defined in:
lib/dhc/logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logdev = nil) ⇒ Logger

Returns a new instance of Logger.



17
18
19
20
21
22
23
24
# File 'lib/dhc/logger.rb', line 17

def initialize(logdev = nil)
  super
  if DHC::Logger.logger
    self.logger = DHC::Logger.logger
  elsif defined? Rails
    self.logger = Rails.logger
  end
end

Class Method Details

.log(severity, message = nil, progname = nil) ⇒ Object



26
27
28
29
# File 'lib/dhc/logger.rb', line 26

def self.log(severity, message = nil, progname = nil)
  return if logger.blank?
  logger.log(severity, message, progname)
end