From ab352bd8eed41f0af8d14417719a7b6c7315e019 Mon Sep 17 00:00:00 2001 From: Sander Peterse Date: Fri, 24 May 2024 17:21:31 +0200 Subject: [PATCH] Also improved debug logging of sync indego client. --- pyIndego/indego_client.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyIndego/indego_client.py b/pyIndego/indego_client.py index 31cacff..5aa445c 100644 --- a/pyIndego/indego_client.py +++ b/pyIndego/indego_client.py @@ -409,7 +409,17 @@ def _request( # noqa: C901 headers["Authorization"] = "Bearer %s" % self._token try: - _LOGGER.debug("%s call to API endpoint %s", method.value, url) + log_headers = headers.copy() + if 'Authorization' in log_headers: + log_headers['Authorization'] = '******' + _LOGGER.debug( + "%s call to API endpoint %s, headers: %s, data: %s", + method.value, + url, + json.dumps(log_headers) if log_headers is not None else '', + json.dumps(data) if data is not None else '', + ) + response = requests.request( method=method.value, url=url,