This commit is contained in:
Sky
2026-03-07 18:54:40 +00:00
commit 7bf95e3e2c
23 changed files with 2436 additions and 0 deletions

24
src/py_onebot/utils.py Normal file
View File

@@ -0,0 +1,24 @@
from datetime import datetime
from sys import stdout, stderr
def log(s: str):
date = f"{datetime.today().year}-{datetime.today().month}-{datetime.today().day} {datetime.today().hour}:{datetime.today().minute}:{datetime.today().second}"
l = f"[{date}] <INFO>\t{s}\n\r"
stdout.write(l)
def elog(s: str):
date = f"{datetime.today().year}-{datetime.today().month}-{datetime.today().day} {datetime.today().hour}:{datetime.today().minute}:{datetime.today().second}"
l = f"\033[0;31m[{date}] ERROR:\t{s} \033[0m\n\r"
stderr.write(l)
def dbg(s):
l = f"\033[0;31m DEBUG:\t{str(s)} \033[0m\n"
print(l)