Class: Tagomatic::Logger

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/tagomatic/logger.rb', line 5

def initialize(options)
  @options = options
end

Instance Method Details

#error(message, optional_exception = nil) ⇒ Object



9
10
11
12
# File 'lib/tagomatic/logger.rb', line 9

def error(message, optional_exception = nil)
  puts "ERROR: #{message}"
  exception optional_exception if optional_exception
end

#exception(exception) ⇒ Object



14
15
16
17
# File 'lib/tagomatic/logger.rb', line 14

def exception(exception)
  puts exception.to_s
  puts exception.backtrace
end

#verbose(message) ⇒ Object



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

def verbose(message)
  puts message if @options[:verbose]
end