Module: Lumberjack::Severity

Included in:
Logger
Defined in:
lib/lumberjack/severity.rb

Overview

The standard severity levels for logging messages.

Constant Summary collapse

DEBUG =

Backward compatibilty with 1.0 API

::Logger::Severity::DEBUG
INFO =
::Logger::Severity::INFO
WARN =
::Logger::Severity::WARN
ERROR =
::Logger::Severity::ERROR
FATAL =
::Logger::Severity::FATAL
UNKNOWN =
::Logger::Severity::UNKNOWN
SEVERITY_LABELS =
%w(DEBUG INFO WARN ERROR FATAL UNKNOWN).freeze

Class Method Summary collapse

Class Method Details

.label_to_level(label) ⇒ Object



21
22
23
# File 'lib/lumberjack/severity.rb', line 21

def label_to_level(label)
  SEVERITY_LABELS.index(label.to_s.upcase) || UNKNOWN
end

.level_to_label(severity) ⇒ Object



17
18
19
# File 'lib/lumberjack/severity.rb', line 17

def level_to_label(severity)
  SEVERITY_LABELS[severity] || SEVERITY_LABELS.last
end