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}] \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)