Class: Honeybadger::Logging::StandardLogger Private

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

Overview

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.

API:

  • private

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:

API:

  • private



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

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.

API:

  • private



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

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