-
Notifications
You must be signed in to change notification settings - Fork 247
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
Replace Kernel warnings with Listen.logger #574
Conversation
Some warning messages cannot be silenced by choosing a logger level. This change standardizes warning messages using the Listen.logger
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.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 2.8
e7eebdc
to
ee6fc3b
Compare
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.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 2.8
Since Listen.logger.warn formats the error message with a `WARN -- : #{msg}` we don't need the [Listen warning] part as it is redundant
ee6fc3b
to
f1e8098
Compare
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.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.0 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 2.8
@AlexB52 I'm concerned that log warnings will almost never be seen. That's why I wonder if instead the warnings could be configurable in |
@ColinDKelley warn = ->(message) {
return if ENV['LISTEN_GEM_DISABLE_WARNING'].present?
Kernel.warn(message)
} What about a Listen::Warning class that calls Something like: module Listen
class Warning
module_function
def warn(message)
return if ENV['LISTEN_GEM_DISABLE_WARNING'].present?
Kernel.warn(message)
end
end
end |
Fix #572
In case we can move these calls to Listen.logger here is the PR for the change.