You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pa...@apache.org on 2018/06/24 20:01:57 UTC

[camel] branch master updated: camel-zipkin: ZipkinTracer remove duplicated checks if debug log level is enabled

This is an automated email from the ASF dual-hosted git repository.

pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 94cbe11  camel-zipkin: ZipkinTracer remove duplicated checks if debug log level is enabled
94cbe11 is described below

commit 94cbe11823ecabf8a1044efcf8a29b7819ffde36
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Sun Jun 24 21:02:57 2018 +0200

    camel-zipkin: ZipkinTracer remove duplicated checks if debug log level is enabled
---
 .../java/org/apache/camel/zipkin/ZipkinTracer.java | 30 +++++++++-------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
index b2fe64c..41e1a97 100644
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
+++ b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
@@ -585,12 +585,10 @@ public class ZipkinTracer extends ServiceSupport implements RoutePolicyFactory,
             String traceId = "" + context.traceIdString();
             String spanId = "" + context.spanId();
             String parentId = context.parentId() != null ? "" + context.parentId() : null;
-            if (LOG.isDebugEnabled()) {
-                if (parentId != null) {
-                    LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
-                } else {
-                    LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
-                }
+            if (parentId != null) {
+                LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
+            } else {
+                LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
             }
         }
     }
@@ -613,12 +611,10 @@ public class ZipkinTracer extends ServiceSupport implements RoutePolicyFactory,
                 String traceId = "" + context.traceIdString();
                 String spanId = "" + context.spanId();
                 String parentId = context.parentId() != null ? "" + context.parentId() : null;
-                if (LOG.isDebugEnabled()) {
-                    if (parentId != null) {
-                        LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
-                    } else {
-                        LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
-                    }
+                if (parentId != null) {
+                    LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
+                } else {
+                    LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
                 }
             }
         }
@@ -673,12 +669,10 @@ public class ZipkinTracer extends ServiceSupport implements RoutePolicyFactory,
                 String traceId = "" + context.traceIdString();
                 String spanId = "" + context.spanId();
                 String parentId = context.parentId() != null ? "" + context.parentId() : null;
-                if (LOG.isDebugEnabled()) {
-                    if (parentId != null) {
-                        LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
-                    } else {
-                        LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
-                    }
+                if (parentId != null) {
+                    LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId));
+                } else {
+                    LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
                 }
             }
         }