-
Notifications
You must be signed in to change notification settings - Fork 128
Pattern argument to log_to_python( ) #40019
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
…y and functionality Signed-off-by: Jose Borreguero <borreguero@gmail.com>
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 enhances the log_to_python()
function in the Python logging utility to accept an optional pattern argument for formatting log messages. The change allows users to specify custom formatting patterns when forwarding Mantid log messages to Python's logging framework.
Key Changes
- Added optional
pattern
parameter tolog_to_python()
function with default valueNone
- Updated function to only apply pattern configuration when a pattern is provided
- Removed the hard-coded
"%t"
pattern and made it configurable
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Framework/PythonInterface/mantid/utils/logging.py | Added optional pattern parameter to log_to_python() function |
docs/source/release/v6.14.0/Framework/LiveData/New_features/39186.rst | Removed unrelated release note entry |
Framework/LiveData/src/SNSLiveEventDataListener.cpp | Code cleanup and comment improvements (unrelated to pattern feature) |
Framework/LiveData/src/ADARA/ADARAParser.cpp | Code cleanup and reorganization (unrelated to pattern feature) |
Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h | Code cleanup and comment improvements (unrelated to pattern feature) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Jose Borreguero <borreguero@gmail.com>
Signed-off-by: Jose Borreguero <borreguero@gmail.com>
Signed-off-by: Jose Borreguero <borreguero@gmail.com>
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.
The main changes are to not override logging configuration by default.
The ADARA changes are renaming some variables and very unrelated. It would have been better as a separate PR, but I understand bundling it in.
Please add a reason why release notes aren't needed.
Description of work
This PR enhances the log_to_python() function in the Python logging utility to accept an optional pattern argument for formatting log messages. The change allows users to specify custom formatting patterns when forwarding Mantid log messages to Python's logging framework.
Key Changes
Added optional pattern parameter to log_to_python() function with default value None
Updated function to only apply pattern configuration when a pattern is provided
Removed the hard-coded "%t" pattern and made it configurable
This does not require release notes. The change is limited to internal API functionality, with no impact on user-facing features, GUI interfaces, or workflows.
EWM 11991
PR against
ornl-next
: #40020To test:
In an environment such as
mantid-developer
, run script:Then verify the contents of
"/tmp/test_40019.log"
:Reviewer
Your comments will be used as part of the gatekeeper process. Comment clearly on what you have checked and tested during your review. Provide an audit trail for any changes requested.
As per the review guidelines:
Gatekeeper
As per the gatekeeping guidelines: