Sha256: 26050e6e900f04231e43acfe670cb91967c2fbded6c4ccff51282a41ff570fb3

Contents?: true

Size: 355 Bytes

Versions: 4

Compression:

Stored size: 355 Bytes

Contents

require 'ougai'

module Rack
  module Ougai
    class Logger
      def initialize(app, level = ::Logger::INFO)
        @app = app
        @level = level
      end

      def call(env)
        logger = ::Ougai::Logger.new(env[RACK_ERRORS])
        logger.level = @level

        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/logger.rb
rack-ougai-0.2.1 lib/rack/ougai/logger.rb
rack-ougai-0.2.0 lib/rack/ougai/logger.rb
rack-ougai-0.1.0 lib/rack/ougai/logger.rb