improved code

This commit is contained in:
2026-01-22 19:38:44 +01:00
parent 42d2758ba5
commit b56fe56f84
5 changed files with 10 additions and 8 deletions

View File

@@ -1,11 +1,13 @@
import sys
import threading
from datetime import datetime
_console_lock = threading.Lock()
def _log(prefix: str, message: str):
time = datetime.now().strftime("[%H:%M:%S]")
with _console_lock:
print(prefix + ": " + message)
print(f"{time} {prefix} {message}")
def info(message: str):
_log("INFO", message)