Repository navigation
Skip argument conversion for disabled SSH log messages - #841
Merged
ronf merged 1 commit intoNov 7, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #841 +/- ##
===========================================
+ Coverage 99.85% 99.86% +0.01%
===========================================
Files 95 102 +7
Lines 27784 32433 +4649
Branches 2908 3128 +220
===========================================
+ Hits 27743 32390 +4647
- Misses 38 39 +1
- Partials 3 4 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Thanks for the PR! This is now merged into "develop" and will be included in the next release. |
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.
Summary
Fixes #839 using the early
isEnabledFor()guard suggested in the report.SSHLogger.log()currently decodes bytes and converts list elements even when the underlying logger will discard the message. Check the effective log level before doing that work, leaving enabled-message conversion and context handling unchanged.Regression coverage
__str__, both when filtered by the log level and when the underlying logger is explicitly disabled. Both cases fail against the unchangeddevelopimplementation.Verification
python -m pytest -q— 1,744 passed, 50 skipped, 4,249 subtests passed. Optional/platform-dependent cases remain skipped; existing PyOpenSSL deprecation warnings are reported.python -m pytest tests/test_logging.py -q— 11 passed, 5 subtests passed.pre-commit run --all-files— all hooks passed.ruff check --isolated --select E,F asyncssh/logging.py tests/test_logging.py— passed.mypy asyncssh/logging.py --follow-imports=silent— no issues in the changed source module.git diff --check— passed.This is an AI-assisted contribution, checked against the regression and full local suite above. These changes are contributed under the project's existing EPL-2.0 OR GPL-2.0-or-later license. Contributor credit: Muhammad Osama Amin.