Class: Muffler::Rack::Logger

Inherits:
Rack::Logger
  • Object
show all
Defined in:
lib/muffler/rack/logger.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/muffler/rack/logger.rb', line 4

def call(env)
  logger = ::Logger.new(env['rack.errors'])
  logger.level = @level

  env['rack.logger'] = logger

  if Muffler.muffle?(env)
    Muffler.muffle(logger) { @app.call(env) }
  else
    @app.call(env)
  end
end