From af818c86965fb72985c9449a699603aa6e9c6123 Mon Sep 17 00:00:00 2001 From: Shabirmean Date: Tue, 22 Dec 2015 18:32:16 +0530 Subject: [PATCH] Added logs to go into log.isDebugEnabled() blocks --- .../mgt/iot/controlqueue/mqtt/MqttSubscriber.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java index 5028c39b5f..a80af1dc77 100644 --- a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java +++ b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/controlqueue/mqtt/MqttSubscriber.java @@ -203,7 +203,10 @@ public abstract class MqttSubscriber implements MqttCallback { */ @Override public void connectionLost(Throwable throwable) { - log.warn("Lost Connection for client: " + this.clientId + " to " + this.mqttBrokerEndPoint + ".\nThis was due to - " + throwable.getMessage()); + if (log.isDebugEnabled()) { + log.warn("Lost Connection for client: " + this.clientId + " to " + this.mqttBrokerEndPoint + + ".\nThis was due to - " + throwable.getMessage()); + } Runnable reSubscriber = new Runnable() { @Override @@ -219,8 +222,6 @@ public abstract class MqttSubscriber implements MqttCallback { log.debug("Could not reconnect and subscribe to ControlQueue."); } } - } else { - return; } } }; @@ -263,7 +264,11 @@ public abstract class MqttSubscriber implements MqttCallback { } String topic = iMqttDeliveryToken.getTopics()[0]; String client = iMqttDeliveryToken.getClient().getClientId(); - log.info("Message - '" + message + "' of client [" + client + "] for the topic (" + topic + ") was delivered successfully."); + + if (log.isDebugEnabled()) { + log.debug("Message - '" + message + "' of client [" + client + "] for the topic (" + topic + + ") was delivered successfully."); + } } /**