Skip to content

Commit 30dd101

Browse files
authored
Remove token from log message on token_test error (#1134)
1 parent 7388848 commit 30dd101

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/lichess.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ def is_final(exception: Exception) -> bool:
7575

7676
def backoff_handler(details: BackoffDetails) -> None:
7777
"""Log exceptions inside functions with the backoff decorator."""
78+
args = details["args"]
79+
kwargs = details["kwargs"]
80+
if "token_test" in args:
81+
kwargs["data"] = "<token redacted>"
7882
logger.debug("Backing off {wait:0.1f} seconds after {tries} tries "
7983
"calling function {target} with args {args} and kwargs {kwargs}".format(**details))
8084
logger.debug(f"Exception: {traceback.format_exc()}")

0 commit comments

Comments
 (0)