Class: Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/maze/loggers/logger.rb

Overview

Monkey patch a ‘trace’ log level into the standard Logger

Defined Under Namespace

Modules: Severity

Constant Summary collapse

SEV_LABEL =
{
  -1 => 'TRACE',
  0 => 'DEBUG',
  1 => 'INFO',
  2 => 'WARN',
  3 => 'ERROR',
  4 => 'FATAL',
  5 => 'ANY'
}

Instance Method Summary collapse

Instance Method Details

#trace(name = nil, &block) ⇒ Object



27
28
29
# File 'lib/maze/loggers/logger.rb', line 27

def trace(name = nil, &block)
  add(TRACE, nil, name, &block)
end

#trace?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/maze/loggers/logger.rb', line 31

def trace?
  @level <= TRACE
end