Class: Franz::Logger
Overview
A powerful, colorful logger for Franz.
Constant Summary collapse
- SEVERITY_COLORS =
Maps each log level to a unique combination of fore- and background colors
{ 'DEBUG' => [ :blue, :default ], 'INFO' => [ :green, :default ], 'WARN' => [ :yellow, :default ], 'ERROR' => [ :red, :default ], 'FATAL' => [ :red, :black ], 'TRACE' => [ :magenta, :default ] }
Constants inherited from Logger
Instance Method Summary collapse
-
#initialize(debug = false, trace = false, out = nil) ⇒ Logger
constructor
Create a new, colorful logger.
Methods inherited from Logger
Constructor Details
#initialize(debug = false, trace = false, out = nil) ⇒ Logger
Create a new, colorful logger.
35 36 37 38 39 40 41 42 43 |
# File 'lib/franz/logger.rb', line 35 def initialize debug=false, trace=false, out=nil colorize = out.nil? out ||= $stdout super out format colorize @trace = true if trace self.level = ::Logger::INFO self.level = ::Logger::DEBUG if debug end |