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