Flush logs, so they actually work

This commit is contained in:
Firepup Sixfifty 2024-07-31 20:15:39 +00:00
parent d84aab7feb
commit a6ecd9a129
Signed by: Firepup650
SSH key fingerprint: SHA256:U0Zp8EhEe3CMqFSrC79CqatzaEiL4sjta80/RSX2XrY

View file

@ -30,6 +30,7 @@ def log(
print(
f"[{level}]{'['+origin+']' if origin else ''}[{time}] {message}",
file=stream,
flush=True,
)
else:
for line in message.split("\n"):
@ -39,5 +40,6 @@ def log(
print(
f"[{level}]{'['+origin+']' if origin else ''}[{time}] {line}",
file=stream,
flush=True,
)
return (log[5:] + "\r\n").encode("utf8")