Sha256: b49fb9f24263b0e21a49382db57f66969220b72cc97196cdf5e7ad5c53f558da
Contents?: true
Size: 568 Bytes
Versions: 28
Compression:
Stored size: 568 Bytes
Contents
# encoding: UTF-8 require 'logger' require 'git-whistles' module Git::Whistles class Logger < ::Logger Colors = { 'DEBUG' => :reset, 'INFO' => :green, 'WARN' => :yellow, 'ERROR' => :red, 'FATAL' => :red, 'UNKNOWN' => :red } def initialize(*args) super self.formatter = self.method(:custom_formatter) end def custom_formatter(severity, time, progname, msg) msg = msg.sub(/([^¬])$/,"\\1\n").sub(/¬$/,'') Term::ANSIColor.send(Colors[severity], msg) end end end
Version data entries
28 entries across 28 versions & 1 rubygems