summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Bielik <martin.bielik@instea.sk>2024-12-07 11:21:29 +0100
committerMartin Bielik <martin.bielik@instea.sk>2024-12-07 11:21:34 +0100
commit7c84f36cf9eb1e68eea861e0683a0d3a2a6faf3a (patch)
treed0e470c45390e4f3194cbfb4895916415e9415d9
parent67be1cc933099e8e648df960267a450e298e49d2 (diff)
downloadvim-ai-7c84f36cf9eb1e68eea861e0683a0d3a2a6faf3a.tar.gz
fix debug logging without arguments
-rw-r--r--py/utils.py3
1 files changed, 2 insertions, 1 deletions
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]'