-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Log undeclared plugin only if it is not disabled #40081
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
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @thomas-kl1. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
We already have tons of completely unnecessary logs about Admin menu rendering, that noone needs. |
Hello @lbajsarowicz I totally agree. My description was not clear and I've tried to updated it in hope to be more understandable. Thanks for your feedback! |
@magento run all tests |
@magento run all tests |
@magento create issue |
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.
Hello @thomas-kl1,
Thanks for the contribution!
The changes looks good to us, but please add some automated test in accordance to DOD.
Thanks
$this->logger->info("Reference to undeclared plugin with name '{$name}'."); | ||
// Log the undeclared plugin when it is not disabled or when the app is in Developer mode. | ||
if ($this->appState->getMode() === State::MODE_DEVELOPER || !($plugin['disabled'] ?? false)) { | ||
$this->logger->debug("Reference to undeclared plugin with name '{$name}'."); |
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.
Any specific reason to change info
to debug
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.
Because it does not have any effect on the platform and it's related to development only.
@lbajsarowicz would argue better than me 😄
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.
@engcom-Hotel Because this does not provide any valuable information outside of Development / Debugging environment, only consumes gigabytes of NewRelic / Sentry, just like the Adminhtml Menu logger.
@magento run all tests |
OFC. I'll check the existing tests and add new ones if necessary. |
Description (*)
Developer may disable a plugin from module (A) with a third party module (B).
The plugin is referenced in di.xml thanks to its name and the attribute "disabled" is set to 'true'. The attribute "type" is not set.
If the module (A) is removed, and the referenced plugin in module (B) is not removed, Magento will report this as an error (info level) in the logs. This has effect to flood the logs with false positive cases.
Indeed, we should only log the plugin who are actually undeclared and not used (enabled and missing instance).
Manual testing scenarios (*)
Module A:
Remove the plugin declaration from module A (above declaration).
Module B (with sequence on Module A):
Expected: no logs.
Actual: logs entries:
Contribution checklist (*)
Resolved issues: