Sha256: b8727c1ee80ceb4dafad78212abebd9fc71325ea0a76081de0ce839376f8985c
Contents?: true
Size: 937 Bytes
Versions: 9
Compression:
Stored size: 937 Bytes
Contents
require 'r10k' require 'log4r' require 'log4r/configurator' module R10K::Logging include Log4r def logger unless @logger @logger = Log4r::Logger.new(self.class.name) @logger.add R10K::Logging.outputter end @logger end class << self include Log4r def included(klass) unless @log4r_loaded Configurator.custom_levels(*%w{DEBUG2 DEBUG1 DEBUG INFO NOTICE WARN ERROR FATAL}) Logger.global.level = Log4r::ALL @log4r_loaded = true end end def level @level || Log4r::WARN # Default level is WARN end def level=(val) outputter.level = val @level = val end def formatter @formatter ||= Log4r::PatternFormatter.new(:pattern => '[%C - %l] %m') end def outputter @outputter ||= Log4r::StderrOutputter.new('console', :level => self.level, :formatter => formatter ) end end end
Version data entries
9 entries across 9 versions & 1 rubygems