Module: Gusteau::Log

Included in:
Node, Server, Vagrant
Defined in:
lib/gusteau/log.rb

Instance Method Summary collapse

Instance Method Details

#info(str, opts = {}) ⇒ Object



23
24
25
# File 'lib/gusteau/log.rb', line 23

def info(str, opts={})
  Inform.info str, opts
end

#log(msg, opts = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gusteau/log.rb', line 5

def log(msg, opts={})
  info "%{prompt}#{msg}", opts.merge(:prompt => prompt)
  if block_given?
    indent
    start_time = Time.now
    yield.tap do
      unindent
      Inform.info "%{prompt}DONE (in #{'%0.2f' % (Time.now - start_time)}s)", :prompt => prompt
    end
  else
    puts "\n"
  end
end

#log_error(msg, opts = {}) ⇒ Object



19
20
21
# File 'lib/gusteau/log.rb', line 19

def log_error(msg, opts={})
  Inform.error "%{prompt}#{msg}", opts.merge(:prompt => prompt)
end