Ver Fonte

chore(logging): configure logging for device mqtt messages

sw há 3 semanas atrás
pai
commit
8a090544a4
1 ficheiros alterados com 3 adições e 0 exclusões
  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);