Fix log timestamps

This commit is contained in:
Firepup Sixfifty 2023-11-04 22:55:26 -05:00
parent 2f8e872901
commit b9f800c73b
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

View file

@ -4,12 +4,14 @@ from sys import stdout, stderr
def log(
message: str, origin: str = "Unknown", level: str = "LOG", time: dt = dt.now()
message: str, origin: str = "Unknown", level: str = "LOG", time: dt = "now"
) -> None:
if level == "EXIT":
stream = stderr
else:
stream = stdout
if time == "now":
dt.now()
if not "\n" in message:
print(f"[{level}][{origin}][{time}] {message}")
else: