Class: Officer::Log

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Singleton
Defined in:
lib/officer/log.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLog

Returns a new instance of Log.



30
31
32
33
34
# File 'lib/officer/log.rb', line 30

def initialize
  @logger = Logger.new STDOUT

  super @logger
end

Class Method Details

.debug(msg) ⇒ Object



7
8
9
# File 'lib/officer/log.rb', line 7

def debug msg
  instance.debug msg
end

.error(msg) ⇒ Object



15
16
17
# File 'lib/officer/log.rb', line 15

def error msg
  instance.error msg
end

.info(msg) ⇒ Object



11
12
13
# File 'lib/officer/log.rb', line 11

def info msg
  instance.info msg
end

.set_log_level(level) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/officer/log.rb', line 19

def set_log_level level
  level = case level
    when 'debug' then Logger::DEBUG
    when 'info'  then Logger::INFO
    else Logger::ERROR
  end

  instance.level = level
end