[>] lvl event.call DEBUG > EVCALL
This commit is contained in:
parent
554e13807d
commit
02a918295d
@ -50,13 +50,14 @@ def zip_logs():
|
||||
|
||||
def setup(console_debug=False, file_debug=False, file_low_debug=False):
|
||||
logger.remove()
|
||||
logger.level("EVCALL", no=9, color="<blue>")
|
||||
fmt = "<green>{elapsed} -- {time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level:<8}</level> | {extra[module]:^12} | {extra[prefix]:<12} | {message}"
|
||||
logger.add(sys.stdout, level="DEBUG" if console_debug else "INFO", format=fmt, backtrace=True, diagnose=True)
|
||||
logger.add(log_file, level="INFO", format=fmt, backtrace=False, diagnose=False, rotation="25 MB")
|
||||
if file_debug:
|
||||
logger.add(log_dir / "debug.log", level="DEBUG", format=fmt, rotation="10 MB")
|
||||
logger.add(log_dir / "debug.log", level=0, format=fmt, rotation="10 MB")
|
||||
if file_low_debug:
|
||||
logger.add(log_dir / "low_debug.log", level="DEBUG", rotation="10 MB")
|
||||
logger.add(log_dir / "low_debug.log", level=0, rotation="10 MB")
|
||||
sys.excepthook = handle_exception
|
||||
threading.excepthook = handle_thread_exception
|
||||
logger.bind(module="LoggerSetup", prefix="init").success("Logger initialized.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user