Sha256: 7da6fefce91503cac819ecee395a08cbf8a69e02e08cc90698c0f87b7b12fef3

Contents?: true

Size: 848 Bytes

Versions: 6

Compression:

Stored size: 848 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 == Log4r::DEBUG
    end

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

    def info?
      @logger.level <= Log4r::INFO
    end

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

    def warn?
      @logger.level <= Log4r::WARN
    end

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

    def error?
      @logger.level <= Log4r::ERROR
    end

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

    def fatal?
      @logger.level <= Log4r::FATAL
    end

    def _fatal(msg)
      @logger.fatal(msg)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slf4r-0.4.2 lib/slf4r/log4r_logger.rb
slf4r-0.4.1 lib/slf4r/log4r_logger.rb
slf4r-0.4.0 lib/slf4r/log4r_logger.rb
slf4r-0.3.3 lib/slf4r/log4r_logger.rb
slf4r-0.3.2 lib/slf4r/log4r_logger.rb
slf4r-0.3.1 lib/slf4r/log4r_logger.rb