class HomebrewAutomation::Logger

Help you see which parts of STDOUT came from HomebrewAutomation

Public Instance Methods

error!(msg) click to toggle source
# File lib/homebrew_automation/logger.rb, line 13
def error!(msg)
  puts(red("homebrew_automation.rb [error] (#{DateTime.now}): ") + msg)
end
info!(msg) click to toggle source
# File lib/homebrew_automation/logger.rb, line 9
def info!(msg)
  puts(bold(green("homebrew_automation.rb [info] (#{DateTime.now}): ")) + msg)
end

Private Instance Methods

bold(x) click to toggle source
# File lib/homebrew_automation/logger.rb, line 32
def bold(x)
  "\e[1m#{x}\e[22m"
end
coloured(colour, msg) click to toggle source

stackoverflow.com/questions/1489183/colorized-ruby-output

# File lib/homebrew_automation/logger.rb, line 20
def coloured(colour, msg)
  "\e[#{colour}m#{msg}\e[0m"
end
green(x) click to toggle source
# File lib/homebrew_automation/logger.rb, line 24
def green(x)
  coloured(32, x)
end
red(x) click to toggle source
# File lib/homebrew_automation/logger.rb, line 28
def red(x)
  coloured(31, x)
end