Sha256: 1ca457f7668f089fa015074df479a0d7a7d15f3eee82e2fa83a22e10ce48c079

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

require 'bio/log/loggersublevels'
require 'bio/log/loggerfilter'
require 'bio/log/loggerusers'
require 'bio/log/loggercli'

module Bio

  module Log

    include Log4r

    # Derived from the Log4r Logger class
    class LoggerPlus < Logger
      include LoggerSubLevels
      include LoggerFilter

      def default_level
        # Log4r::Logger::DEBUG
        6
      end
      def default_sub_level
      end

      def debug_ msg, options = {}
        if options[:act]
          options[:act].debug(self,msg)
        else
          debug msg
        end
      end

      def info_ msg, options = {}
        if options[:act]
          options[:act].info(self,msg)
        else
          info msg
        end
      end

      def warn_ msg, options = {}
        if options[:act]
          options[:act].warn(self,msg)
        else
          warn msg
        end
      end

      def error_ msg, options = {}
        if options[:act]
          options[:act].error(self,msg)
        else
          error msg
        end
      end

      def fatal_ msg, options = {}
        if options[:act]
          options[:act].fatal(self,msg)
        else
          fatal msg
        end
      end

      def [] name
        super
      end

    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bio-logger-1.0.1 lib/bio/log/logger.rb
bio-logger-1.0.0 lib/bio/log/logger.rb
bio-logger-0.9.0 lib/bio/log/logger.rb