-
-
Notifications
You must be signed in to change notification settings - Fork 449
Updated (monolog) logging #5148
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: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR refactors logging functionality by extracting logging-related code from the Mage class into a new dedicated helper Mage_Core_Helper_Log. This reduces complexity in the main Mage::log() method, improves testability, and prepares the codebase for additional logging handlers and formatters. The refactoring includes moving XML path constants, implementing static helper methods for log level normalization, and adding comprehensive unit tests.
Key changes:
- Extracted logging logic into new
Mage_Core_Helper_Loghelper with static methods - Simplified
Mage::log()by delegating to helper methods - Added unit tests for the new logging helper methods
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| app/code/core/Mage/Core/Helper/Log.php | New helper class containing logging utility methods (getLogLevel, getHandler, getLineFormatter, etc.) |
| app/Mage.php | Refactored to use new Mage_Core_Helper_Log methods, reducing complexity |
| app/code/core/Mage/Core/Helper/Data.php | Deprecated XML_PATH_DEV_LOG_* constants with references to new locations |
| tests/unit/Mage/Core/Helper/LogTest.php | Unit tests for the new logging helper |
| tests/unit/Traits/DataProvider/Mage/Core/Helper/LogTrait.php | Data provider for log level tests |
| app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php | Updated constant references to use Mage_Core_Helper_Log |
| .rector.php | Added Rector rules to automatically update constant references |
| .phpstorm.meta.php/*.meta.php | Updated PHPStorm metadata for IDE support (removed unrelated mm_ignition entries, added core/log helper) |
|



Description (*)
Cleanup.
Reused PSR3-fix. (#5144). Thanks to @Hanmac .
Moved some logging code from
Mageto newMage_Core_Helper_Log.Mage::log()Related Pull Requests
Zend_Logwithmonolog#5126