Sha256: 0a3ab1decc6c62fc2f874625a3642c57ad8d04cf6874d62300f35364ba25b56d

Contents?: true

Size: 353 Bytes

Versions: 55

Compression:

Stored size: 353 Bytes

Contents

require 'logger'

module Rack
  # Sets up rack.logger to write to rack.errors stream
  class Logger
    def initialize(app, level = ::Logger::INFO)
      @app, @level = app, level
    end

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

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

Version data entries

55 entries across 53 versions & 14 rubygems

Version Path
rack-2.0.9.4 lib/rack/logger.rb
rack-2.0.9.3 lib/rack/logger.rb
rack-2.0.9.2 lib/rack/logger.rb
rack-2.0.9.1 lib/rack/logger.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-2.0.5/lib/rack/logger.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rack-2.0.8/lib/rack/logger.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/logger.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
rack-2.0.9 lib/rack/logger.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/rack-2.0.8/lib/rack/logger.rb
rack-2.0.8 lib/rack/logger.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
tdiary-5.1.0 vendor/bundle/gems/rack-2.0.7/lib/rack/logger.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/logger.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/logger.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/logger.rb