Sha256: 9773c7b2b49404c089cb0885e4b6ed302e95e97a7ad5732896e0c840da0b6508

Contents?: true

Size: 384 Bytes

Versions: 73

Compression:

Stored size: 384 Bytes

Contents

# frozen_string_literal: true

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

73 entries across 57 versions & 15 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/rack-2.2.10/lib/rack/logger.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/rack-2.2.10/lib/rack/logger.rb
rack-2.2.10 lib/rack/logger.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/logger.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/logger.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/logger.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rack-2.2.7/lib/rack/logger.rb
rack-2.2.9 lib/rack/logger.rb
rack-2.2.8.1 lib/rack/logger.rb
rack-2.1.4.4 lib/rack/logger.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.3/lib/rack/logger.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.7/lib/rack/logger.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-2.2.4/lib/rack/logger.rb
rack-2.2.8 lib/rack/logger.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.7/lib/rack/logger.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.4/lib/rack/logger.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-2.2.3/lib/rack/logger.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/logger.rb
rack-2.2.7 lib/rack/logger.rb
rack-2.2.6.4 lib/rack/logger.rb