Class: RuboCop::Cop::Isucon::Sinatra::RackLogger
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Isucon::Sinatra::RackLogger
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/isucon/sinatra/rack_logger.rb
Overview
Disable request.env['rack.logger']
logging
Constant Summary collapse
- MSG =
"Don't use `request.env['rack.logger']`"
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/rubocop/cop/isucon/sinatra/rack_logger.rb', line 39 def on_send(node) return unless rack_logger?(node) add_offense(node) do |corrector| perform_autocorrect(corrector: corrector, node: node) end end |
#rack_logger?(node) ⇒ Boolean
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rubocop/cop/isucon/sinatra/rack_logger.rb', line 23 def_node_matcher :rack_logger?, <<~PATTERN (send (send (send (send nil? :request) :env ) :[] (str "rack.logger") ) {:debug | :error | :fatal | :info | :warn} ... ) PATTERN |