lib/log.rb in forj-0.0.39 vs lib/log.rb in forj-0.0.40
- old
+ new
@@ -109,13 +109,14 @@
end
def error(message)
@oOutLogger.error(message + ANSI.clear_line)
@oFileLogger.error(message)
end
- def fatal(message)
+ def fatal(message, e)
@oOutLogger.fatal(message + ANSI.clear_line)
- @oFileLogger.fatal(message)
+ @oFileLogger.fatal("%s\n%s\n%s" % [message, e.message, e.backtrace.join("\n")]) if e
+ @oFileLogger.fatal(message)
end
def warn(message)
@oOutLogger.warn(message + ANSI.clear_line)
@oFileLogger.warn(message)
@@ -150,21 +151,21 @@
def error(message)
$FORJ_LOGGER.error(message)
end
- def fatal(rc, message)
- $FORJ_LOGGER.fatal(message)
+ def fatal(rc, message, e = nil)
+ $FORJ_LOGGER.fatal(message, e)
puts 'Issues found. Please fix it and retry. Process aborted.'
exit rc
end
def set_level(level)
$FORJ_LOGGER.set_level(level)
end
def state(message)
- print("%s%s ...\r" % [message, ANSI.clear_line]) if $FORJ_LOGGER.level == Logger::INFO
+ print("%s ...%s\r" % [message, ANSI.clear_line]) if $FORJ_LOGGER.level == Logger::INFO
end
def high_level_msg(message)
# Not DEBUG and not INFO. Just printed to the output.
puts ("%s" % [message]) if $FORJ_LOGGER.level > 1