Module: Berkshelf::Mixin::Logging

Included in:
Berkshelf, Berksfile
Defined in:
lib/berkshelf/mixin/logging.rb

Instance Method Summary collapse

Instance Method Details

#logObject



4
5
6
# File 'lib/berkshelf/mixin/logging.rb', line 4

def log
  Berkshelf::Logger
end

#log_exception(ex) ⇒ Object

Log an exception and it’s backtrace to FATAL

Parameters:

  • ex (Exception)


11
12
13
14
# File 'lib/berkshelf/mixin/logging.rb', line 11

def log_exception(ex)
  log.fatal("#{ex.class}: #{ex}")
  log.fatal(ex.backtrace.join("\n")) unless ex.backtrace.nil?
end