diff --git a/plugin_common/plugin_interface.py b/plugin_common/plugin_interface.py index 649e16b..a3411a4 100644 --- a/plugin_common/plugin_interface.py +++ b/plugin_common/plugin_interface.py @@ -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} 不存在,使用默认配置") diff --git a/plugins/message_summary/main.py b/plugins/message_summary/main.py index 9935e48..a49e1fe 100644 --- a/plugins/message_summary/main.py +++ b/plugins/message_summary/main.py @@ -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="群聊总结") diff --git a/plugins/stats_collector/decorators.py b/plugins/stats_collector/decorators.py index 1eb1788..1d4d562 100644 --- a/plugins/stats_collector/decorators.py +++ b/plugins/stats_collector/decorators.py @@ -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]: diff --git a/plugins/stats_collector/main.py b/plugins/stats_collector/main.py index daf89f9..756c038 100644 --- a/plugins/stats_collector/main.py +++ b/plugins/stats_collector/main.py @@ -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 diff --git a/plugins/stats_dashboard/main.py b/plugins/stats_dashboard/main.py index 4324e6b..c353505 100644 --- a/plugins/stats_dashboard/main.py +++ b/plugins/stats_dashboard/main.py @@ -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