Class: Honeybadger::Logging::StandardLogger Private

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/honeybadger/logging.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

ConfigLogger, FormattedLogger

Instance Method Summary collapse

Methods inherited from Base

#level

Constructor Details

#initialize(logger = Logger.new(nil)) ⇒ StandardLogger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of StandardLogger.

Raises:

  • (ArgumentError)


90
91
92
93
94
95
# File 'lib/honeybadger/logging.rb', line 90

def initialize(logger = Logger.new(nil))
  raise ArgumentError, 'logger not specified' unless logger
  raise ArgumentError, 'logger must be a logger' unless logger.respond_to?(:add)

  @logger = logger
end

Instance Method Details

#add(severity, msg, progname = LOGGER_PROG) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



97
98
99
# File 'lib/honeybadger/logging.rb', line 97

def add(severity, msg, progname=LOGGER_PROG)
  @logger.add(severity, msg, progname)
end