forked from Firepup650/FireBot
Fix log timestamps
This commit is contained in:
parent
2f8e872901
commit
b9f800c73b
1 changed files with 3 additions and 1 deletions
4
logs.py
4
logs.py
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue