-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add useful message for logger silence error #381
Add useful message for logger silence error #381
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Is not better to check if the logger respond to silence and raise an exception if not instead of rescue an exception? |
Yes, that sounds like a great idea. I'll make that change and see if I can address the build errors. |
Is it worth considering just in-lining LoggerSilence instead? It's friendlier for users to call, but doing it manually is not exactly complicated. |
Yes, that's another good idea I considered but wasn't sure how it'd be On Friday, October 7, 2016, Matthew Draper [email protected] wrote:
Ross Kaffenberger |
Ah, looking closer, I see LoggerSilence is only as short as it is because it uses Perhaps +1 on |
Add useful message for logger silence error Raise logger silence error on respond_to? for quiet assets
8d316cb
to
673fe08
Compare
Changes made, let me know if you have any more suggestions. |
@rafaelfranca Just checking on this to see if there's anything else I can do to help move it forward. Thanks! |
@rafaelfranca we just ran into this issue too. |
Just for reference, this is how it's handled in core rails: |
Thanks @tenderlove |
The introduction of the quiet assets middleware assumes that
::Rails.logger
responds to#silence
. For projects using incompatible logger objects, like Ruby'sLogger
, a (potentially confusing)NoMethodError
is raised in development whenconfig.assets.quiet
is enabled.This change now provides an informative error message to help developers update their configured logger to take advantage of quiet asset logging.
Fixes #376