Fix the log levels mapping#597
Conversation
The `INFO` log level is usually not enough to get useful information from the libssh regarding the low-level issues that we would like to be able to resolve. This can be made even more fine grained, but I do not think less verbose logs would be much useful anyway. Related is the issue in pylibssh, which maps the DEBUG verbosity to something that is not debug in libssh itself: ansible/pylibssh#597
|
It'd be useful to have tests in such PRs. I'm unable to verify what this patch affects without them. |
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
68dd501 to
a55aea1
Compare
|
@webknjaz the current version should be working version with tests of what, I hope, you were trying to describe. I think it will need some polishing so I would be happy for your inputs. |
|
|
webknjaz
left a comment
There was a problem hiding this comment.
I wrote most of the review months ago. Submitting just now. This might need a few more iterations. Hopefully, a few things are actionable immediately.
|
Turns out that also the |
808a4aa to
2c034b8
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
If you want a "log nothing", I'd probably set the threshold high in the mapping. Something like $ python
Python 3.13.2 (main, Feb 28 2025, 20:34:46) [GCC 14.2.1 20241221] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.getLevelNamesMapping()
{'CRITICAL': 50, 'FATAL': 50, 'ERROR': 40, 'WARN': 30, 'WARNING': 30, 'INFO': 20, 'DEBUG': 10, 'NOTSET': 0}
>>> logging.fatal
<function fatal at 0x7fa77ea62fc0>
>>> logging.CRITICAL
50
>>> logging.FATAL
50
>>> logging.ERROR
40P.S. I wonder if |
|
My final review pass gives a few grammar hints but the main concern is the configuration mismatch between the fixture and the tests (provided that the docs edits are cosmetic/secondary). |
|
I hope I addressed all your comments now. Please have a look |
|
FTR, the last failure is flaky #756 (comment) |
Saw that, but did not bother with that as it looks like its not the last version as we needed to clarify the testing in the last comment. |
The libssh provides the most verbose logging with SSH_LOG_TRACE, which was not mapped to any of the standard values so the users are unable to get full debug logs. These are critical for libssh developers to be able to investigate issues. This also creates callback for libssh to feed the logs into the python logging system to be able to process the logs the python way. The conftest no longer needs setting log level as it is set to the highest level by default and filtered only on the python side. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>



SUMMARY
The libssh provides the most verbose logging with SSH_LOG_TRACE, which was mapped to
logging.CRITICAL, causing the users being unable to get full debug logs. These are critical for libssh developers to be able to investigate issues.ISSUE TYPE