调整日志内容

This commit is contained in:
liuwei
2025-03-19 15:24:00 +08:00
parent d5b71ff5bd
commit ea6eecc3b0
5 changed files with 10 additions and 11 deletions

View File

@@ -77,9 +77,9 @@ class PluginInterface(ABC):
if os.path.exists(config_path):
with open(config_path, "r", encoding="utf-8") as f:
plugin_config = toml.load(f)
self.LOG.info(f"{config_path} 加载插件{self.name}配置:{plugin_config}")
self.LOG.debug(f"{config_path} 加载插件{self.name}配置:{plugin_config}")
self._config.update(plugin_config)
self.LOG.info(f"{config_path} 加载插件配置成功")
self.LOG.debug(f"{config_path} 加载插件配置成功")
return True
else:
self.LOG.info(f"插件配置文件 {config_path} 不存在,使用默认配置")

View File

@@ -62,14 +62,14 @@ class MessageSummaryPlugin(MessagePluginInterface):
def start(self) -> bool:
"""启动插件"""
self.LOG.info(f"[{self.name}] 插件已启动")
self.status = PluginStatus.RUNNING
self.LOG.info(f"{self.name} 插件已启动")
return True
def stop(self) -> bool:
"""停止插件"""
self.LOG.info(f"[{self.name}] 插件已停止")
self.status = PluginStatus.STOPPED
self.LOG.info(f"{self.name} 插件已停止")
return True
@plugin_stats_decorator(plugin_name="群聊总结")

View File

@@ -20,10 +20,10 @@ def plugin_stats_decorator(plugin_name: str) -> Callable:
"""
# 获取日志记录器
logger = logging.getLogger(f"StatsCollector.{plugin_name}")
logger.info(f"为插件 '{plugin_name}' 应用统计装饰器")
logger.debug(f"为插件 '{plugin_name}' 应用统计装饰器")
def decorator(func: Callable) -> Callable:
logger.info(f"装饰 '{plugin_name}'{func.__name__} 方法")
logger.debug(f"装饰 '{plugin_name}'{func.__name__} 方法")
@functools.wraps(func)
def wrapper(self, message: Dict[str, Any]) -> Tuple[bool, str]:

View File

@@ -69,7 +69,6 @@ class StatsCollectorPlugin(PluginInterface):
self.event_manager.register(PluginCallEndEvent, self.handle_plugin_call_end)
self.event_manager.register(PluginCallErrorEvent, self.handle_plugin_error)
self.logger.info("统计收集插件已初始化")
return True
def handle_plugin_call_start(self, event: PluginCallStartEvent) -> None:
@@ -158,12 +157,12 @@ class StatsCollectorPlugin(PluginInterface):
def start(self) -> bool:
"""启动插件"""
self.LOG.info(f"[{self.name}] 插件已启动")
self.status = PluginStatus.RUNNING
self.LOG.info(f"{self.name} 插件已启动")
return True
def stop(self) -> bool:
"""停止插件"""
self.LOG.info(f"[{self.name}] 插件已停止")
self.status = PluginStatus.STOPPED
self.LOG.info(f"{self.name} 插件已停止")
return True

View File

@@ -112,12 +112,12 @@ class StatsDashboardPlugin(PluginInterface):
def start(self) -> bool:
"""启动插件"""
self.LOG.info(f"[{self.name}] 插件已启动")
self.status = PluginStatus.RUNNING
self.LOG.info(f"{self.name} 插件已启动")
return True
def stop(self) -> bool:
"""停止插件"""
self.LOG.info(f"[{self.name}] 插件已停止")
self.status = PluginStatus.STOPPED
self.LOG.info(f"{self.name} 插件已停止")
return True