Skip to content

Commit

Permalink
Also improved debug logging of sync indego client.
Browse files Browse the repository at this point in the history
  • Loading branch information
sander1988 committed May 24, 2024
1 parent 604783d commit ab352bd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pyIndego/indego_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ab352bd

Please sign in to comment.