From 9d2c50b8be4d3997941c52badb670186330cd303 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Sun, 28 Jan 2018 14:26:00 +0100 Subject: [PATCH] Prevent printing debug message when not requested --- lib/mqtt_client.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mqtt_client.dart b/lib/mqtt_client.dart index 02d7c8a..673ec4a 100644 --- a/lib/mqtt_client.dart +++ b/lib/mqtt_client.dart @@ -338,7 +338,9 @@ class MqttClient { _resetTimer(); } - print("[mqttClient] [" + m._topic + "][" + m._payload + "]"); + if (debugMessage) { + print("[mqttClient] [" + m._topic + "][" + m._payload + "]"); + } // notify the client of the new topic / payload if (_onSubscribeDataMap != null && _onSubscribeDataMap[m._topic] != null) _onSubscribeDataMap[m._topic](m._topic, m._payload);