调整日志内容
This commit is contained in:
@@ -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} 不存在,使用默认配置")
|
||||
|
||||
@@ -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="群聊总结")
|
||||
|
||||
@@ -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]:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user