class ActiveHook::Log

Public Class Methods

new() click to toggle source
# File lib/activehook/log.rb, line 13
def initialize
  @log = ::Logger.new(STDOUT)
  @log.formatter = proc do |_severity, datetime, _progname, msg|
    "#{msg}\n"
  end
end

Public Instance Methods

err(msg, action: :no_exit) click to toggle source
# File lib/activehook/log.rb, line 24
def err(msg, action: :no_exit)
  @log.info("[ \e[31mER\e[0m ] #{msg}")
  exit 1 if action == :exit
end
info(msg) click to toggle source
# File lib/activehook/log.rb, line 20
def info(msg)
  @log.info("[ \e[32mOK\e[0m ] #{msg}")
end