Class: Bellboy::Logger

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

Overview

Simple stdout logger

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Logger

Returns a new instance of Logger.



26
27
28
# File 'lib/bellboy/logger.rb', line 26

def initialize(options = {})
  @loglevel = level(options)
end

Instance Method Details

#debug(message) ⇒ Object Also known as: verbose

Output a debug message



36
37
38
# File 'lib/bellboy/logger.rb', line 36

def debug(message)
  $stderr.puts(message) unless @loglevel < Bellboy::LOG_LEVEL_DEBUG
end

#log(message) ⇒ Object

Output a normal informational message



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

def log(message)
  puts(message) unless @loglevel < Bellboy::LOG_LEVEL_INFO
end