-
-
Notifications
You must be signed in to change notification settings - Fork 520
fix(rails): properly skip silenced logs from AR #2775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8b2a19b to
55b9653
Compare
8733e4e to
01ac704
Compare
| # @param event [ActiveSupport::Notifications::Event] The SQL event | ||
| def sql(event) | ||
| return unless Sentry.initialized? | ||
| return if logger && !logger.info? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work if the user passes in a different severity to silence?
https://github.com/rails/rails/blob/14c115b120ed089331ff3dc13f36bd9129ced33d/activesupport/lib/active_support/logger_silence.rb#L16-L19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this PR is targeting default which is ERROR, and it should solve the solid_queue silencing being ignored issue. Handling levels is actually a bigger task, because we just default to info right now.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2775 +/- ##
==========================================
- Coverage 90.18% 90.17% -0.02%
==========================================
Files 132 132
Lines 5280 5281 +1
==========================================
Hits 4762 4762
- Misses 518 519 +1
🚀 New features to boost your workflow:
|
This ensures that if
silencedlogging was used, the ActiveRecord log subscriber won't log silenced events.