diff --git a/robot.py b/robot.py index a27f744..8459b56 100644 --- a/robot.py +++ b/robot.py @@ -262,7 +262,9 @@ class Robot: # 并发执行,限制最大并发数 xx = asyncio.create_task(self._process_with_semaphore(wxmsg)) else: - self.LOG.debug(f"MESSAGE:{data_temp}") + # 只有当 Ret 不等于 0 或者 不包含 KeyBuf 时才打印 + if not (isinstance(data_temp, dict) and data_temp.get("Ret") == 0 and "KeyBuf" in data_temp): + self.LOG.debug(f"MESSAGE:{data_temp}") # 使用异步睡眠替代忙等待循环 await asyncio.sleep(2)