Module: GreenLog::Severity
- Defined in:
- lib/green_log/severity.rb
Overview
Levels of 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
- NAMES =
%i[DEBUG INFO WARN ERROR FATAL].freeze
Class Method Summary collapse
Class Method Details
.name(severity) ⇒ Object
23 24 25 |
# File 'lib/green_log/severity.rb', line 23 def name(severity) NAMES[severity] end |
.resolve(arg) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/green_log/severity.rb', line 27 def resolve(arg) value = _resolve(arg) return value if value && (DEBUG..FATAL).cover?(value) raise ArgumentError, "invalid severity: #{arg.inspect}" end |