feat: Hide outputs in the logs for path.exists method - #43
Merged
Merged
Conversation
Contributor
|
We don't publish DEVs .whl. |
There was a problem hiding this comment.
Pull request overview
This PR updates CustomPosixPath.exists() to suppress command logging output more robustly by wrapping the command execution in DisableLogger, optionally passing level=log_levels.OUT when that constructor parameter is supported, and adds unit tests to validate both code paths.
Changes:
- Updated
CustomPosixPath.exists()to conditionally passleveltoDisableLoggerbased oninspect.signature(...). - Added unit tests covering
DisableLogger()vsDisableLogger(level=...)usage inexists(). - Updated imports to support the new logging-control behavior in both implementation and tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
mfd_connect/pathlib/path.py |
Wraps CustomPosixPath.exists() execution with DisableLogger, conditionally adding level support. |
tests/unit/test_mfd_connect/test_pathlib/test_path.py |
Adds tests that mock inspect.signature and assert the correct DisableLogger invocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Output doesn't matter for the user, check works with rc and "permission denied" in the output Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
adrianlasota
force-pushed
the
log_path_logging
branch
from
July 9, 2026 13:02
2afe352 to
90d1c80
Compare
mchromin
approved these changes
Jul 31, 2026
a-gorczew
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
CustomPosixPath.exists()method to suppress logging output more robustly by using theDisableLoggercontext manager with optional parameters, depending on its constructor signature. It also adds comprehensive tests to verify this behavior.Logging control improvements
CustomPosixPath.exists()to useDisableLoggerwith thelevelparameter if supported, ensuring that logging output is properly suppressed during command execution. The method now dynamically checks for the presence of thelevelparameter inDisableLogger's constructor usinginspect.signature.DisableLoggerto the imports inmfd_connect/pathlib/path.pyto support the new logging control logic.Testing enhancements
CustomPosixPath.exists()usesDisableLoggerwith or without thelevelparameter, depending on the constructor signature. These tests use mocking to simulate different signatures and assert correct usage.log_levelsimport to the test file to support the new tests.