Class: EXEL::Logging::LoggerWrapper

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/exel/logging/logger_wrapper.rb

Overview

Wraps calls to a logger to add EXEL::Logging prefix to log messages

Constant Summary collapse

LOG_LEVELS =
%i(debug info warn error fatal unknown).freeze

Instance Method Summary collapse

Instance Method Details

#add(severity, message = nil, progname = nil) ⇒ Object


23
24
25
26
27
28
# File 'lib/exel/logging/logger_wrapper.rb', line 23

def add(severity, message = nil, progname = nil)
  if message.nil? && block_given?
    message = yield
  end
  __getobj__.add(severity, "#{Logging.prefix}#{message}", progname)
end