Module: Logging

Included in:
RoboScott
Defined in:
lib/roboscott.rb

Constant Summary collapse

ESCAPES =
{ :green  => "\033[32m",
:yellow => "\033[33m",
:red    => "\033[31m",
:reset  => "\033[0m" }

Instance Method Summary collapse

Instance Method Details

#emit(opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/roboscott.rb', line 15

def emit(opts={})
  color   = opts[:color]
  message = opts[:message]
  print ESCAPES[color]
  print message
  print ESCAPES[:reset]
  print "\n"
end

#error(message) ⇒ Object



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

def error(message)
  emit(:message => message, :color => :red)
end