From 8033bca9494d1d353383b4701a20fa921dda9f8f Mon Sep 17 00:00:00 2001 From: wangfq Date: Thu, 2 Jul 2026 14:45:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(DBNetClient):=20=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0=E5=AE=8C=E6=95=B4=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=20JSON=20=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DBNetClient/tcp_json_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DBNetClient/tcp_json_client.py b/DBNetClient/tcp_json_client.py index f3045e1..6deb005 100644 --- a/DBNetClient/tcp_json_client.py +++ b/DBNetClient/tcp_json_client.py @@ -148,12 +148,13 @@ class TcpJsonClient: try: obj = json.loads(raw) except json.JSONDecodeError: - self._log(f"<<< (invalid JSON) {raw[:80]}") + self._log(f"<<< RAW: {raw.strip()}") + self._log(f"<<< (invalid JSON)") continue + self._log(f"<<< RAW: {raw.strip()}") cmd = obj.get("cmd", "") msg_id = obj.get("msg_id", 0) - # 检查是否有 code 字段(响应帧) if "code" in obj: code = obj.get("code", -1) self._log(f"<<< {cmd} code={code} msg_id={msg_id}")