instance method
ignore
Ruby on Rails edge
Since edgeSignature
ignore(*patterns)
Registers patterns of messages to ignore. Ignored messages aren’t forwarded to the underlying logger, whatever their severity. Returns self, so it can be chained on the constructor.
Regexps are matched against the message, strings are matched literally:
logger.ignore(/Noisy/, 'Also noisy')
logger.error('Noisy message') # not forwarded
logger.error('Also noisy') # not forwarded
Patterns are matched against message.to_s, so lazily generated messages are evaluated even when they end up ignored.
Parameters
-
patternsrest
Source
# File activesupport/lib/active_support/proxy_logger.rb, line 51
def ignore(*patterns)
return self if patterns.empty?
@ignored_patterns.concat(patterns)
@ignored = Regexp.union(@ignored_patterns)
self
end
Defined in activesupport/lib/active_support/proxy_logger.rb line 51
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::ProxyLogger