feat(DBNetClient): 接收日志打印完整原始 JSON 数据
This commit is contained in:
@@ -148,12 +148,13 @@ class TcpJsonClient:
|
|||||||
try:
|
try:
|
||||||
obj = json.loads(raw)
|
obj = json.loads(raw)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
self._log(f"<<< (invalid JSON) {raw[:80]}")
|
self._log(f"<<< RAW: {raw.strip()}")
|
||||||
|
self._log(f"<<< (invalid JSON)")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
self._log(f"<<< RAW: {raw.strip()}")
|
||||||
cmd = obj.get("cmd", "")
|
cmd = obj.get("cmd", "")
|
||||||
msg_id = obj.get("msg_id", 0)
|
msg_id = obj.get("msg_id", 0)
|
||||||
# 检查是否有 code 字段(响应帧)
|
|
||||||
if "code" in obj:
|
if "code" in obj:
|
||||||
code = obj.get("code", -1)
|
code = obj.get("code", -1)
|
||||||
self._log(f"<<< {cmd} code={code} msg_id={msg_id}")
|
self._log(f"<<< {cmd} code={code} msg_id={msg_id}")
|
||||||
|
|||||||
Reference in New Issue
Block a user