Sha256: 8a20f9686398e3ba289e8275ff00fd681938dcddd852ddf1cda9f66e925a594f

Contents?: true

Size: 529 Bytes

Versions: 2

Compression:

Stored size: 529 Bytes

Contents

require 'logger'

module Logster
  class Logger < ::Logger
    attr_accessor :store

    def initialize(store)
      super(nil)
      @store = store
    end

    def add(severity, message, progname, &block)
      if severity < @level
        return true
      end

      progname ||= @progname
      if message.nil?
        if block_given?
          message = yield
        else
          message = progname
          progname = @progname
        end
      end

     @store.report(severity, progname, message)

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logster-0.0.2 lib/logster/logger.rb
logster-0.0.1 lib/logster/logger.rb