From 7c84f36cf9eb1e68eea861e0683a0d3a2a6faf3a Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Sat, 7 Dec 2024 11:21:29 +0100 Subject: fix debug logging without arguments --- py/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'py/utils.py') diff --git a/py/utils.py b/py/utils.py index d3b7c8d..264c0c4 100644 --- a/py/utils.py +++ b/py/utils.py @@ -204,7 +204,8 @@ def printDebug(text, *args): if not is_debugging: return with open(debug_log_file, "a") as file: - file.write(f"[{datetime.datetime.now()}] " + text.format(*args) + "\n") + message = text.format(*args) if len(args) else text + file.write(f"[{datetime.datetime.now()}] " + message + "\n") OPENAI_RESP_DATA_PREFIX = 'data: ' OPENAI_RESP_DONE = '[DONE]' -- cgit v1.2.3