class Stacker::PrettyLogger
Public Class Methods
new(logger)
click to toggle source
Calls superclass method
# File lib/stacker/logging.rb, line 13 def initialize logger super old_formatter = logger.formatter logger.formatter = proc do |level, time, prog, msg| unless msg.start_with?("\e") color = case level when 'FATAL' then :red when 'WARN' then :yellow when 'INFO' then :blue when 'DEBUG' then '333333' else :default end msg = msg.color(color) end old_formatter.call level, time, prog, msg end end
Public Instance Methods
inspect(object)
click to toggle source
# File lib/stacker/logging.rb, line 43 def inspect object info object.to_yaml[4..-1].strip.indent, highlight: :yaml end