logger import

This commit is contained in:
Divided by Zer0 2022-10-16 01:38:36 +02:00
parent 683804b941
commit 974743fbcc
2 changed files with 13 additions and 12 deletions

View File

@ -0,0 +1 @@
from .logger import logger,set_logger_verbosity,quiesce_logger

View File

@ -70,7 +70,6 @@ genfmt = "<level>{level: <10}</level> @ <green>{time:YYYY-MM-DD HH:mm:ss}</green
initfmt = "<magenta>INIT </magenta> | <level>{extra[status]: <10}</level> | <magenta>{message}</magenta>"
msgfmt = "<level>{level: <10}</level> | <level>{message}</level>"
try:
logger.level("GENERATION", no=24, color="<cyan>")
logger.level("PROMPT", no=23, color="<yellow>")
logger.level("INIT", no=31, color="<white>")
@ -80,8 +79,7 @@ try:
# Messages contain important information without which this application might not be able to be used
# As such, they have the highest priority
logger.level("MESSAGE", no=61, color="<green>")
except TypeError:
pass
logger.__class__.generation = partialmethod(logger.__class__.log, "GENERATION")
logger.__class__.prompt = partialmethod(logger.__class__.log, "PROMPT")
@ -100,3 +98,5 @@ config = {
],
}
logger.configure(**config)
logger.add("logs/log_{time:MM-DD-YYYY!UTC}.log", rotation="8 MB", compression="zip", level='INFO') # Once the file is too old, it's rotated