diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-07-30 14:47:01 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-07-30 14:47:01 -0700 |
commit | dacf8a3269f2545bf442449da60817bd6a23a7df (patch) | |
tree | de31d2638b59e6571cecb24d35c639eb0701a3a0 /docs/api-usage.rst | |
parent | 17414f787a70a0d916193ac71bccce0297c4e4e8 (diff) | |
download | gitlab-jlvillal/logging-mask-tokens.tar.gz |
feat(client): mask tokens by default when loggingjlvillal/logging-mask-tokens
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r-- | docs/api-usage.rst | 21 |
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 |