summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-05-02 00:22:20 +0200
committerNejc Habjan <nejc.habjan@siemens.com>2022-07-29 23:38:46 +0200
commit08519b78e827278dc5d66b5d5a66eaeea0a500d5 (patch)
treee7380c1272bf49dac337a77f7b3143a59e398a2e /docs/api-usage.rst
parent17414f787a70a0d916193ac71bccce0297c4e4e8 (diff)
downloadgitlab-feat/logging-mask-tokens.tar.gz
feat(client): mask tokens by default when loggingfeat/logging-mask-tokens
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index 434de38..3c561b1 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -384,6 +384,27 @@ user. For example:
p = gl.projects.create({'name': 'awesome_project'}, sudo='user1')
+Logging
+=======
+
+To enable debug logging from the underlying ``requests`` and ``http.client`` calls,
+you can use ``enable_debug()`` on your ``Gitlab`` instance. For example:
+
+.. code-block:: python
+
+ import os
+ import gitlab
+
+ gl = gitlab.Gitlab(private_token=os.getenv("GITLAB_TOKEN"))
+ gl.enable_debug()
+
+By default, python-gitlab will mask the token used for authentication in logging output.
+If you'd like to debug credentials sent to the API, you can disable masking explicitly:
+
+.. code-block:: python
+
+ gl.enable_debug(mask_credentials=False)
+
.. _object_attributes:
Attributes in updated objects