Module: Logger::Forward

Defined in:
lib/utilrb/logger/forward.rb

Overview

Forward logger output methods to the logger attribute, so that we can do

module MyModule
  extend Logger::Forward
end

MyModule.debug “debug_info” instead of

MyModule.logger.debug "debug_info"

Instance Method Summary collapse

Instance Method Details

#log_levelObject

The logger level


19
20
21
# File 'lib/utilrb/logger/forward.rb', line 19

def log_level
    logger.level
end

#log_level=(level) ⇒ Object

Sets the logger's level


24
25
26
# File 'lib/utilrb/logger/forward.rb', line 24

def log_level=(level)
    logger.level = level
end

#log_nest(size, level = nil, &block) ⇒ Object

Forwarded to Logger#nest


34
35
36
# File 'lib/utilrb/logger/forward.rb', line 34

def log_nest(size, level = nil, &block)
    logger.nest(size, level, &block)
end

#log_pp(level, object, *first_line_format) ⇒ Object

Forwarded to Logger#log_pp


39
40
41
# File 'lib/utilrb/logger/forward.rb', line 39

def log_pp(level, object, *first_line_format)
    logger.log_pp(level, object, *first_line_format)
end

#log_silent(&block) ⇒ Object

Forwarded to Logger#silent


29
30
31
# File 'lib/utilrb/logger/forward.rb', line 29

def log_silent(&block)
    logger.silent(&block)
end