module HubClustersCreator::Logging
Logging
is few helper functions for logging
Public Instance Methods
error(string)
click to toggle source
# File lib/hub-clusters-creator/logging.rb, line 30 def error(string) Kernel.warn formatted_string(string, symbol: '!') end
info(string, options = {})
click to toggle source
# File lib/hub-clusters-creator/logging.rb, line 22 def info(string, options = {}) print formatted_string("[info] #{dated_string(string)}", options) end
warn(string)
click to toggle source
# File lib/hub-clusters-creator/logging.rb, line 26 def warn(string) Kernel.warn formatted_string(string, symbol: '*') end
Private Instance Methods
dated_string(string)
click to toggle source
# File lib/hub-clusters-creator/logging.rb, line 36 def dated_string(string) "[#{Time.now}] #{string}" end
formatted_string(string, options = {})
click to toggle source
# File lib/hub-clusters-creator/logging.rb, line 40 def formatted_string(string, options = {}) symbol = options[:symbol] || '' string = string.to_s "#{symbol}#{string}\n" end