Sha256: bb46e43a691d191c6a46640aa5d4ac87542f465cc2fda5ab19b593e2af91c072

Contents?: true

Size: 390 Bytes

Versions: 3

Compression:

Stored size: 390 Bytes

Contents

require 'logger'

module Irrc
  module Logging
    def logger=(logger)
      @logger = logger
    end

    def logger
      @logger ||= Logger.new(STDERR).tap {|l| l.level = Logger::WARN }
    end

    class Logger < ::Logger
      def add(severity, message = nil, progname = nil, &block)
        super(severity, message, "(#{Thread.current[:id]}) #{progname}")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
irrc-0.2.2 lib/irrc/logging.rb
irrc-0.2.1 lib/irrc/logging.rb
irrc-0.2.0 lib/irrc/logging.rb