Module: Miam::Logger::Helper

Included in:
Client, Driver, PasswordManager
Defined in:
lib/miam/logger.rb

Instance Method Summary collapse

Instance Method Details

#log(level, message, log_options = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/miam/logger.rb', line 19

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