Module: Kelbim::Logger::ClientHelper

Instance Method Summary collapse

Instance Method Details

#log(level, message, color, log_id = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/kelbim/logger.rb', line 24

def log(level, message, color, log_id = nil)
  message = "[#{level.to_s.upcase}] #{message}" unless level == :info
  message << ": #{log_id}" if log_id
  message << ' (dry-run)' if @options && @options.dry_run
  logger = (@options && @options.logger) || Kelbim::Logger.instance
  logger.send(level, message.send(color))
end