Sha256: 53ea4337e34aebc3117f69287cbcf1397d9ed6ef0c519cad3b504caac0043183

Contents?: true

Size: 414 Bytes

Versions: 26

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

require 'logger'

require_relative 'constants'

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

26 entries across 25 versions & 6 rubygems

Version Path
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/rack-3.0.11/lib/rack/logger.rb
rack-3.0.10 lib/rack/logger.rb
rack-3.0.9.1 lib/rack/logger.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rack-3.0.9/lib/rack/logger.rb
rack-3.0.9 lib/rack/logger.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/logger.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rack-3.0.8/lib/rack/logger.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rack-3.0.7/lib/rack/logger.rb
rack-3.0.8 lib/rack/logger.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rack-3.0.7/lib/rack/logger.rb
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/rack-3.0.7/lib/rack/logger.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/rack-3.0.7/lib/rack/logger.rb
rack-3.0.7 lib/rack/logger.rb
rack-3.0.6.1 lib/rack/logger.rb
rack-3.0.6 lib/rack/logger.rb
rack-3.0.5 lib/rack/logger.rb
rack-3.0.4.2 lib/rack/logger.rb
rack-3.0.4.1 lib/rack/logger.rb
rack-3.0.4 lib/rack/logger.rb
rack-3.0.3 lib/rack/logger.rb