Skip to content

Commit 492dffa

Browse files
Jakujewebknjaz
andcommitted
Add changelog fragments
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
1 parent a5aae44 commit 492dffa

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fixed the log level mapping to cover the entire ``libssh`` range
2+
-- by :user:`Jakuje` and :user:`webknjaz`.
3+
4+
Previously it was not possible to set the most verbose ``libssh`` log level
5+
``SSH_LOG_TRACE`` to get the most verbose log messages useful for debugging
6+
connection issues.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Made ``libssh`` use the Python :external+python:mod:`logging` system
2+
-- by :user:`Jakuje` and :user:`webknjaz`.
3+
4+
Previously the underlying ``libssh`` library was writing its logs directly
5+
from the C-level into ``stderr``, which caused inconsistent behavior.
6+
7+
The default log level is now set to :data:`ANSIBLE_PYLIBSSH_TRACE`
8+
and the downstream loggers are able to trim the verbosity down.
9+
If you need performance, it is possible to disable logging on the ``libssh``
10+
side at the source by setting a lower logging value, for example:
11+
12+
.. code-block:: python
13+
14+
ssh_session.set_log_level(ANSIBLE_PYLIBSSH_NOLOG)
15+
16+
Additionally, the log level can be now be set also through the session initializer:
17+
18+
.. code-block:: python
19+
20+
ssh = Session(log_verbosity=ANSIBLE_PYLIBSSH_TRACE)
21+
22+
23+
or the ``connect()`` method arguments:
24+
25+
.. code-block:: python
26+
27+
ssh.connect(log_verbosity=ANSIBLE_PYLIBSSH_TRACE)
28+
29+
Setting any levels imported from :external+python:mod:`!logging` is also supported.

0 commit comments

Comments
 (0)