Sha256: 287580ed78ab3906becfe7a6d06b0ca22be3033a8396de15a5ac4d2933c73076
Contents?: true
Size: 831 Bytes
Versions: 11
Compression:
Stored size: 831 Bytes
Contents
require 'logging' module Blazing module Logger # include Logging.globally # here we setup a color scheme called 'bright' Logging.color_scheme( 'bright', :levels => { :debug => :green, :info => :green, :warn => :yellow, :error => [:white, :on_red], :fatal => [:white, :on_red] } ) Logging.appenders.stdout( 'stdout', :layout => Logging.layouts.pattern( :pattern => ' ------> [blazing] %-5l: %m\n', :color_scheme => 'bright' ) ) Logging.logger.root.appenders = 'stdout' Logging.logger.root.level = :info Logging.consolidate :root %w[debug info warn error fatal].each do |level| define_method level do |message| Logging.logger[self].send(level, message) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems