feat: 依赖检查移动到main.py

This commit is contained in:
Junyan Qin
2024-02-29 11:10:30 +00:00
parent 1f07a8a9e3
commit 71f2a58acb
3 changed files with 30 additions and 16 deletions

View File

@@ -16,6 +16,10 @@ log_colors_config = {
async def init_logging() -> logging.Logger:
# 删除所有现有的logger
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)
level = logging.INFO
if "DEBUG" in os.environ and os.environ["DEBUG"] in ["true", "1"]:
@@ -46,7 +50,7 @@ async def init_logging() -> logging.Logger:
qcg_logger.debug("日志初始化完成,日志级别:%s" % level)
logging.basicConfig(
level=logging.INFO, # 设置日志输出格式
level=logging.CRITICAL, # 设置日志输出格式
format="[DEPR][%(asctime)s.%(msecs)03d] %(pathname)s (%(lineno)d) - [%(levelname)s] :\n%(message)s",
# 日志输出的格式
# -8表示占位符让输出左对齐输出长度都为8位