Class: Honeybadger::Logging::ConfigLogger Private

Inherits:
StandardLogger show all
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.

Constant Summary collapse

LOCATE_CALLER_LOCATION =

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

Regexp.new("#{Regexp.escape(__FILE__)}").freeze
CALLER_LOCATION =

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

Regexp.new("#{Regexp.escape(File.expand_path('../../../', __FILE__))}/(.*)").freeze
INFO_SUPPLEMENT =

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

' level=%s pid=%s'.freeze
DEBUG_SUPPLEMENT =

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

' at=%s'.freeze

Instance Method Summary collapse

Methods inherited from Base

#level

Constructor Details

#initialize(config, logger = Logger.new(nil)) ⇒ ConfigLogger

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 ConfigLogger


119
120
121
122
123
124
# File 'lib/honeybadger/logging.rb', line 119

def initialize(config, logger = Logger.new(nil))
  @config = config
  @tty = STDOUT.tty?
  @tty_level = @config.log_level(:'logging.tty_level')
  super(logger)
end

Instance Method Details

#add(severity, msg) ⇒ 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.


126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/honeybadger/logging.rb', line 126

def add(severity, msg)
  return true if suppress_tty?(severity)

  # There is no debug level in Honeybadger. Debug logs will be logged at
  # the info level if the debug config option is on.
  if severity == Logger::Severity::DEBUG
    return true if suppress_debug?
    super(Logger::Severity::INFO, supplement(msg, Logger::Severity::DEBUG))
  else
    super(severity, supplement(msg, severity))
  end
end

#debug?Boolean

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:

  • (Boolean)

139
140
141
# File 'lib/honeybadger/logging.rb', line 139

def debug?
  @config.log_debug?
end