Class: Silencer::Rack::Logger
- Inherits:
-
Rack::Logger
- Object
- Rack::Logger
- Silencer::Rack::Logger
- Defined in:
- lib/silencer/rack/logger.rb
Constant Summary
Constants included from Methods
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, *args) ⇒ Logger
constructor
A new instance of Logger.
Methods included from Util
Methods included from Methods
Constructor Details
#initialize(app, *args) ⇒ Logger
Returns a new instance of Logger.
15 16 17 18 19 20 21 22 23 |
# File 'lib/silencer/rack/logger.rb', line 15 def initialize(app, *args) opts = (args) @silence = wrap(opts.delete(:silence)) @routes = define_routes(@silence, opts) @enable_header = opts.delete(:enable_header) { true } super(app, *args) end |
Instance Method Details
#call(env) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/silencer/rack/logger.rb', line 25 def call(env) if silence_request?(env, enable_header: @enable_header) quiet(env) do super end else super end end |