refactor(logger): 替换print为logger并添加自定义日志样式支持

将配置文件加载中的print语句替换为logger.info,以统一日志输出。同时新增log_decorators.py文件,提供自定义日志样式的装饰器支持,并在logger.py中实现自定义样式处理器的添加和移除功能。
This commit is contained in:
墨梓柒
2025-04-23 22:27:44 +08:00
parent 5782d4425b
commit 7438c2dd76
3 changed files with 245 additions and 56 deletions

View File

@@ -2,6 +2,7 @@ import os
import toml
import sys
import argparse
from .global_logger import logger
PG_NAMESPACE = "paragraph"
ENT_NAMESPACE = "entity"
@@ -63,8 +64,8 @@ def _load_config(config, config_file_path):
if "persistence" in file_config:
config["persistence"] = file_config["persistence"]
print(config)
print("Configurations loaded from file: ", config_file_path)
# print(config)
logger.info(f"从文件中读取配置: {config_file_path}")
parser = argparse.ArgumentParser(description="Configurations for the pipeline")