Module: Logger::Severity

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

Overview

Logging severity.

Constant Summary collapse

DEBUG =

Low-level information, mostly for developers.

0
INFO =

Generic (useful) information about system operation.

1
WARN =

A warning.

2
ERROR =

A handleable error condition.

3
FATAL =

An unhandleable error that results in a program crash.

4
UNKNOWN =

An unknown message that should always be logged.

5

Class Method Summary collapse

Class Method Details

.coerce(severity) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/logger/severity.rb', line 29

def self.coerce(severity)
  if severity.is_a?(Integer)
    severity
  else
    key = severity.to_s.downcase
    LEVELS[key] || raise(ArgumentError, "invalid log level: #{severity}")
  end
end