Sha256: 2654a3bc294a37455682c1e6d30a21796d5d1bf945df2ff00d5392b49ec0d56d

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

require 'log4r'
require 'slf4r/abstract_logger_facade'

module Slf4r
  class LoggerFacade < AbstractLoggerFacade
    
    attr_reader :logger
    
    def initialize(name)
      super
      @logger = ::Log4r::Logger::Repository[name] || ::Log4r::Logger.new(name)
    end

    public 

    def debug?
      @logger.level == 0
    end

    def _debug(msg)
      @logger.debug(msg)
    end

    def info?
      @logger.level <= 1
    end

    def _info(msg)
      @logger.info(msg)
    end

    def warn?
      @logger.level <= 2
    end

    def _warn(msg)
      @logger.warn(msg)
    end

    def error?
      @logger.level <= 3
    end

    def _error(msg)
      @logger.error(msg)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slf4r-0.3.0 lib/slf4r/log4r_logger.rb
slf4r-0.2.0 lib/slf4r/log4r_logger.rb