Commit ec5332a9 authored by Carit Zhu's avatar Carit Zhu 🎱

Modify some console output as logger print for MqttListener.

parent ec85cc9b
......@@ -80,18 +80,18 @@ public class MqttListener implements MqttCallback {
try {
mqttAsyncClient.subscribe(listener_topic, mqttconfig.getQos());
} catch (MqttException e) {
System.out.println("Error: " + e.getMessage());
logger.error("connection MqttException: " + e.getMessage());
}
}
@Override
public void onFailure(IMqttToken iMqttToken, Throwable throwable) {
System.out.println("connection fail with client id");
logger.error("connection fail with client id");
}
});
this.mqttAsyncClient.setCallback(this);
} catch (Exception e) {
e.printStackTrace();
logger.error("mqtt initialize exception: " + e.getMessage());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment