class RuboCop::Cop::Vendor::RollbarLogger
This cop checks for non-error usage of Rollbar and suggests using `Rails.logger` instead.
The main reason for this suggestion is that Rollbar has a quota that is often multiple times smaller than the log quota and it may become expensive, also an error tracker should not be used as a logger.
@example
# bad Rollbar.info("Stale message") # good Rails.logger.info("Stale message")
Constants
- MSG
Public Instance Methods
autocorrect(node)
click to toggle source
# File lib/rubocop/cop/vendor/rollbar_logger.rb, line 34 def autocorrect(node) lambda do |corrector| corrector.replace(node.children[0].loc.expression, 'Rails.logger') end end
on_send(node)
click to toggle source
# File lib/rubocop/cop/vendor/rollbar_logger.rb, line 28 def on_send(node) return unless bad_method?(node) add_offense(node, location: node.children[0].loc.expression) end