feat(DBNetClient): 接收日志打印完整原始 JSON 数据

This commit is contained in:
wangfq
2026-07-02 14:45:11 +08:00
parent 43d815a4fe
commit 8033bca949

View File

@@ -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}")