Class: Silencer::Rails::Logger
- Inherits:
-
Rails::Rack::Logger
- Object
- Rails::Rack::Logger
- Silencer::Rails::Logger
- Defined in:
- lib/silencer/rails/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.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/silencer/rails/logger.rb', line 16 def initialize(app, *args) opts = (args) @silence = wrap(opts.delete(:silence)) @routes = define_routes(@silence, opts) @enable_header = opts.delete(:enable_header) { true } normalized_args = normalize(args) if normalized_args super(app, normalized_args) else super(app) end end |
Instance Method Details
#call(env) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/silencer/rails/logger.rb', line 31 def call(env) if silence_request?(env, enable_header: @enable_header) quiet do super end else super end end |