-
Notifications
You must be signed in to change notification settings - Fork 18
feat (webpack-image-sizes-plugin): adds option to silence console output #461
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
Allows users to suppress console output from the plugin. This adds a `silence` option to the plugin configuration, which, when set to `true`, will prevent most console logs from being printed. This can be useful in environments where excessive logging is undesirable.
Reviewer's GuideAdds a new Sequence Diagram for Conditional Logging LogicsequenceDiagram
participant Caller
participant Plugin as WebpackImageSizesPlugin
participant Console
Caller->>Plugin: invokes method (e.g., apply())
Plugin->>Plugin: log("info", "Log message")
alt this.options.silence == false
Plugin->>Console: console.info("Log message")
else this.options.silence == true
%% No action for console output
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @firestar300 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
🚀
Allows users to suppress console output from the plugin.
This adds a
silence
option to the plugin configuration, which, when set totrue
, will prevent most console logs from being printed. This can be useful in environments where excessive logging is undesirable.Summary by Sourcery
Add a
silence
configuration flag to WebpackImageSizesPlugin to globally suppress console logs, implement a conditional logging wrapper, and update the default plugin setup to use this option.New Features:
silence
option to WebpackImageSizesPlugin to suppress console output when enabledEnhancements:
log
method and replace all direct console calls to respect thesilence
flagDocumentation:
silence
optionChores:
silence: true
by default in plugin instantiation within config/plugins.js