Sha256: 5a413238668f83f1b62676616ff3e6a4a2854c2c408ed84bb58bfd90ea048600

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

#
# IGNORE THIS FILE
#

module SemanticLogger
  module Appender
    # Logger appender
    #
    #   Maps the SemanticLogger API's to the Rails log, or Ruby Logger
    #
    #   The following changes are made:
    #     The klass_name is prefixed on all log entries if available.
    #
    # Note: For performance, the original Rails Logger or Ruby Logger is returned,
    #       with that instance populated with the new API's to support SymanticLogger
    #
    # Installation:
    #    Rails.logger = SemanticLogger::LoggerAppender.new(Rails.logger)
    # Also works with the Ruby Logger
    #    logger = Logger.new ....
    #    Rails.log = LoggerAppender.new()
    #
    # ActiveResource::BufferedLogger
    #    ...
    #
    # Append to the default Rails log
    #
    # Note: The Rails log must be initialized prior to this Appender being started
    #       Or, the original Rails log must be passed into the initializer
    #
    class Logger
      @@level_map = {:trace => :debug, :debug=>:debug, :info=>:info, :warn=>:warn, :error=>:error}

      # These are a problem at the appender level, need to move to API
      # Not consistent with the other appenders levels
      def level
        @logger.level
      end

      def level=(new_level)
        @logger.level = new_level
      end



    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
semantic_logger-0.3.1 lib/semantic_logger/rails.rb
semantic_logger-0.3.0 lib/semantic_logger/rails.rb
semantic_logger-0.2.0 lib/semantic_logger/rails.rb
semantic_logger-0.1.0 lib/semantic_logger/rails.rb
semantic_logger-0.0.2 lib/semantic_logger/rails.rb