Enhance backend startup logging and API endpoint display

- Updated `run.py` to conditionally print startup information only in the reloader process to avoid duplicate logs in debug mode.
- Modified `__init__.py` to log startup and completion messages based on the reloader process condition.
- Added warnings suppression in `graph_builder.py` for Pydantic v2 regarding Field usage.
- Revised `ontology_generator.py` to enforce strict design guidelines for entity types and relationships, ensuring compliance with new requirements.
- Improved logging behavior in `logger.py` to prevent log propagation to the root logger, avoiding duplicate outputs.
This commit is contained in:
666ghj
2025-11-28 18:59:36 +08:00
parent 3156f9453d
commit e98da6b53e
5 changed files with 165 additions and 50 deletions

View File

@@ -31,6 +31,9 @@ def setup_logger(name: str = 'mirofish', level: int = logging.DEBUG) -> logging.
logger = logging.getLogger(name)
logger.setLevel(level)
# 阻止日志向上传播到根 logger避免重复输出
logger.propagate = False
# 如果已经有处理器,不重复添加
if logger.handlers:
return logger