You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by jm...@apache.org on 2018/01/13 23:04:37 UTC

[incubator-plc4x] 04/06: fix logging so no side effects

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

jmclean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit 716ac61b06f268502e99c5dba036172a41277e3c
Author: Justin Mclean <jm...@apache.org>
AuthorDate: Sun Jan 14 09:59:28 2018 +1100

    fix logging so no side effects
---
 .../s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
index d1cb2b6..0622712 100644
--- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
@@ -195,7 +195,9 @@ public class S7Protocol extends MessageToMessageCodec<IsoTPMessage, S7Message> {
 
         if (userData.readByte() != S7_PROTOCOL_MAGIC_NUMBER) {
             logger.warn("Expecting S7 protocol magic number.");
-            logger.debug("Got Data: {}", ByteBufUtil.hexDump(userData));
+            if (logger.isDebugEnabled()) {
+                logger.debug("Got Data: {}", ByteBufUtil.hexDump(userData));
+            }
             return;
         }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@plc4x.apache.org" <co...@plc4x.apache.org>.