Module: Droonga::Logger::Level

Defined in:
lib/droonga/logger.rb

Constant Summary collapse

TRACE =
0
DEBUG =
1
INFO =
2
WARN =
3
ERROR =
4
FATAL =
5
LABELS =
[
  "trace",
  "debug",
  "info",
  "warn",
  "error",
  "fatal",
]

Class Method Summary collapse

Class Method Details

.defaultObject



56
57
58
# File 'lib/droonga/logger.rb', line 56

def default
  ENV["DROONGA_LOG_LEVEL"] || label(WARN)
end

.label(level) ⇒ Object



48
49
50
# File 'lib/droonga/logger.rb', line 48

def label(level)
  LABELS[level]
end

.value(label) ⇒ Object



52
53
54
# File 'lib/droonga/logger.rb', line 52

def value(label)
  LABELS.index(label.to_s)
end