ソースを参照

chore(logging): configure logging for device mqtt messages

sw 3 週間 前
コミット
8a090544a4
1 ファイル変更3 行追加0 行削除
  1. 3 0
      src/domain/mqttServiceForDevice.ts

+ 3 - 0
src/domain/mqttServiceForDevice.ts

@@ -147,6 +147,9 @@ const startListening = () => {
   });
 
   mqttClient.on('message', (topic, message) => {
+    console.log(
+      `【接收设备mqtt消息】 topic是 ${topic} , message : ${JSON.parse(message.toString())}`
+    );
     if (topic === MQTT_TOPIC) {
       const parsedMessage: MqttMessage = JSON.parse(message.toString());
       handleMqttMessage(parsedMessage);