class Honeybadger::Logging::ConfigLogger

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/honeybadger/logging.rbs

class Honeybadger::Logging::ConfigLogger < Honeybadger::Logging::StandardLogger
  def add: (Integer severity, String msg, ?String progname) -> true
  def debug?: () -> false
  def supplement: (String msg, Integer severity) -> String
  def suppress_tty?: (Integer severity) -> false
end

def add(severity, msg)

Experimental RBS support (using type sampling data from the type_fusion project).

def add: (Integer severity, String msg, ?String progname) -> true

This signature was generated using 2 samples from 1 application.

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

def caller_location

def caller_location
  if caller && caller.find {|l| l !~ LOCATE_CALLER_LOCATION && l =~ CALLER_LOCATION }
    Regexp.last_match(1)
  end
end

def debug?

Experimental RBS support (using type sampling data from the type_fusion project).

def debug?: () -> false

This signature was generated using 1 sample from 1 application.

def debug?
  @config.log_debug?
end

def initialize(config, logger = Logger.new(nil))

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

def supplement(msg, severity)

Experimental RBS support (using type sampling data from the type_fusion project).

def supplement: (String msg, Integer severity) -> String

This signature was generated using 4 samples from 1 application.

def supplement(msg, severity)
  return msg unless msg.kind_of?(String)
  r = msg.dup
  r << sprintf(INFO_SUPPLEMENT, severity, Process.pid)
  if severity == Logger::Severity::DEBUG && l = caller_location
    r << sprintf(DEBUG_SUPPLEMENT, l.dump)
  end
  r
end

def suppress_debug?

def suppress_debug?
  !debug?
end

def suppress_tty?(severity)

Experimental RBS support (using type sampling data from the type_fusion project).

def suppress_tty?: (Integer severity) -> false

This signature was generated using 2 samples from 1 application.

def suppress_tty?(severity)
  @tty && severity < @tty_level
end