Sha256: 747be2c0fcdfd7b9fb525bc57006947fa2f7996413f3911a8e4c4ad4229b4a2b

Contents?: true

Size: 381 Bytes

Versions: 4

Compression:

Stored size: 381 Bytes

Contents

require 'ougai'

module Rack
  module Ougai
    class ConstantLogger
      def initialize(app, logger)
        raise "logger must be an Ougai::Logging (got: #{logger.class.name})." unless logger.is_a?(::Ougai::Logging)

        @app = app
        @logger = logger
      end

      def call(env)
        env[RACK_LOGGER] = @logger
        @app.call(env)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rack-ougai-0.3.0 lib/rack/ougai/constant_logger.rb
rack-ougai-0.2.1 lib/rack/ougai/constant_logger.rb
rack-ougai-0.2.0 lib/rack/ougai/constant_logger.rb
rack-ougai-0.1.0 lib/rack/ougai/constant_logger.rb