camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Fix logging of reconnection attempt, and use slf4j log formatting with parameters.
Date Tue, 13 Dec 2016 09:44:22 GMT
Repository: camel
Updated Branches:
  refs/heads/master 85bd238d4 -> b18dab5a1


Fix logging of reconnection attempt, and use slf4j log formatting with parameters.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b18dab5a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b18dab5a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b18dab5a

Branch: refs/heads/master
Commit: b18dab5a148e37913707acf4555ee09631c98336
Parents: 85bd238
Author: Pim Moerenhout <pim.moerenhout@gmail.com>
Authored: Tue Dec 13 10:30:15 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 13 10:43:10 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/smpp/SmppConsumer.java | 14 +++++++-------
 .../org/apache/camel/component/smpp/SmppProducer.java | 14 ++++++++------
 2 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b18dab5a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
index 5c50a6f..6be353a 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppConsumer.java
@@ -80,12 +80,12 @@ public class SmppConsumer extends DefaultConsumer {
 
     @Override
     protected void doStart() throws Exception {
-        LOG.debug("Connecting to: " + getEndpoint().getConnectionString() + "...");
+        LOG.debug("Connecting to: {}...", getEndpoint().getConnectionString());
 
         super.doStart();
         session = createSession();
 
-        LOG.info("Connected to: " + getEndpoint().getConnectionString());
+        LOG.info("Connected to: {}", getEndpoint().getConnectionString());
     }
 
     private SMPPSession createSession() throws IOException {
@@ -116,12 +116,12 @@ public class SmppConsumer extends DefaultConsumer {
 
     @Override
     protected void doStop() throws Exception {
-        LOG.debug("Disconnecting from: " + getEndpoint().getConnectionString() + "...");
+        LOG.debug("Disconnecting from: {}...", getEndpoint().getConnectionString());
 
         super.doStop();
         closeSession();
 
-        LOG.info("Disconnected from: " + getEndpoint().getConnectionString());
+        LOG.info("Disconnected from: {}", getEndpoint().getConnectionString());
     }
 
     private void closeSession() {
@@ -146,7 +146,7 @@ public class SmppConsumer extends DefaultConsumer {
                     public void run() {
                         boolean reconnected = false;
                         
-                        LOG.info("Schedule reconnect after " + initialReconnectDelay + "
millis");
+                        LOG.info("Schedule reconnect after {} millis", initialReconnectDelay);
                         try {
                             Thread.sleep(initialReconnectDelay);
                         } catch (InterruptedException e) {
@@ -158,7 +158,7 @@ public class SmppConsumer extends DefaultConsumer {
                                 && attempt < configuration.getMaxReconnect())
{
                             try {
                                 attempt++;
-                                LOG.info("Trying to reconnect to {} - attempt #", getEndpoint().getConnectionString(),
attempt);
+                                LOG.info("Trying to reconnect to {} - attempt #{}", getEndpoint().getConnectionString(),
attempt);
                                 session = createSession();
                                 reconnected = true;
                             } catch (IOException e) {
@@ -172,7 +172,7 @@ public class SmppConsumer extends DefaultConsumer {
                         }
                         
                         if (reconnected) {
-                            LOG.info("Reconnected to " + getEndpoint().getConnectionString());
                       
+                            LOG.info("Reconnected to {}", getEndpoint().getConnectionString());
                         }
                     }
                 };

http://git-wip-us.apache.org/repos/asf/camel/blob/b18dab5a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
index 048d5bc..f8acdda 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppProducer.java
@@ -39,6 +39,8 @@ import org.slf4j.LoggerFactory;
 
 /**
  * An implementation of @{link Producer} which use the SMPP protocol
+ *
+ * @version
  */
 public class SmppProducer extends DefaultProducer {
 
@@ -84,7 +86,7 @@ public class SmppProducer extends DefaultProducer {
     }
 
     private SMPPSession createSession() throws IOException {
-        LOG.debug("Connecting to: " + getEndpoint().getConnectionString() + "...");
+        LOG.debug("Connecting to: {}...", getEndpoint().getConnectionString());
         
         SMPPSession session = createSMPPSession();
         session.setEnquireLinkTimer(this.configuration.getEnquireLinkTimer());
@@ -102,7 +104,7 @@ public class SmppProducer extends DefaultProducer {
                         NumberingPlanIndicator.valueOf(configuration.getNumberingPlanIndicator()),
                         ""));
         
-        LOG.info("Connected to: " + getEndpoint().getConnectionString());
+        LOG.info("Connected to: {}", getEndpoint().getConnectionString());
         
         return session;
     }
@@ -153,12 +155,12 @@ public class SmppProducer extends DefaultProducer {
 
     @Override
     protected void doStop() throws Exception {
-        LOG.debug("Disconnecting from: " + getEndpoint().getConnectionString() + "...");
+        LOG.debug("Disconnecting from: {}...", getEndpoint().getConnectionString());
 
         super.doStop();
         closeSession();
 
-        LOG.info("Disconnected from: " + getEndpoint().getConnectionString());
+        LOG.info("Disconnected from: {}", getEndpoint().getConnectionString());
     }
     
     private void closeSession() {
@@ -182,7 +184,7 @@ public class SmppProducer extends DefaultProducer {
                     public void run() {
                         boolean reconnected = false;
                         
-                        LOG.info("Schedule reconnect after " + initialReconnectDelay + "
millis");
+                        LOG.info("Schedule reconnect after {} millis", initialReconnectDelay);
                         try {
                             Thread.sleep(initialReconnectDelay);
                         } catch (InterruptedException e) {
@@ -193,7 +195,7 @@ public class SmppProducer extends DefaultProducer {
                                 && attempt < configuration.getMaxReconnect())
{
                             try {
                                 attempt++;
-                                LOG.info("Trying to reconnect to {} - attempt #", getEndpoint().getConnectionString(),
attempt);
+                                LOG.info("Trying to reconnect to {} - attempt #{}", getEndpoint().getConnectionString(),
attempt);
                                 session = createSession();
                                 reconnected = true;
                             } catch (IOException e) {


Mime
View raw message