feat: DBNMQTTool 日志增强 — 收发打印 topic + payload 详情

新增 _log_send() / _log_recv() 两个统一日志方法:
- 发送: 标签 + → topic + PASTE:{精简payload}
- 接收: ← topic + summary + RECV:{精简payload}
- payload >200/300 字符自动截断

覆盖所有收发路径:
- [模拟]/[协议]/[自定义]/[命令] 发送
- 响应/loop_data/event_report/heartbeat/Initialize 接收
- mqtt_client.py 自动订阅事件日志
This commit is contained in:
wangfq
2026-07-07 17:47:58 +08:00
parent 5e4e1b1ec7
commit b932dd7c6f
2 changed files with 37 additions and 8 deletions
+1
View File
@@ -68,6 +68,7 @@ class MqttClient:
self._notify_status(True, "已连接到 Broker")
from .protocol import TOPIC_ALL_DEVICE_UP
print(f"[MqttClient] auto-subscribe: {TOPIC_ALL_DEVICE_UP}", flush=True)
client.subscribe(TOPIC_ALL_DEVICE_UP, qos=1)
else:
self._connected = False