Class: Atatus::Config::LogLevelMap Private

Inherits:
Object
  • Object
show all
Defined in:
lib/atatus/config/log_level_map.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

LEVELS =

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.

{
  debug: Logger::DEBUG,
  info: Logger::INFO,
  warn: Logger::WARN,
  error: Logger::ERROR,
  fatal: Logger::FATAL,
  trace: Logger::DEBUG,
  warning: Logger::WARN,
  critical: Logger::FATAL,
  off: Logger::FATAL
}.freeze
DEFAULT =

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.

Logger::INFO

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ 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.



38
39
40
41
42
43
44
# File 'lib/atatus/config/log_level_map.rb', line 38

def call(value)
  if value.is_a?(Integer)
    LEVELS.value?(value) ? value : DEFAULT
  else
    LEVELS.fetch(value.to_sym, DEFAULT)
  end
end