Files
FastapiAdmin/backend/app/utils/banner.py
T
zhangtao 6ccafb63ef refactor: 优化配置和日志初始化流程
移除RELOAD配置项,改为根据环境变量动态设置
调整banner显示逻辑,确保在日志初始化后执行
将部分错误日志改为警告级别
更新.gitignore,添加缓存目录
重构测试文件,添加健康检查测试
2025-11-26 01:09:35 +08:00

11 lines
354 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from app.config.path_conf import BANNER_FILE
from app.core.logger import log
def worship(env: str) -> None:
"""
获取项目启动Banner(优先读取 banner.txt
"""
if BANNER_FILE.exists():
banner = BANNER_FILE.read_text(encoding='utf-8')
banner = f"🚀 当前运行环境: {env}\n{banner}"
log.info(banner)