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 c6c50b1e79f02663534eff8518d72f2682764ab5 Author: Justin Mclean <jmcl...@apache.org> AuthorDate: Sun Jan 14 09:58:04 2018 +1100 fix logging so no side effects --- .../plc4x/java/isotp/netty/IsoTPProtocol.java | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/IsoTPProtocol.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/IsoTPProtocol.java index d845158..12c3467 100644 --- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/IsoTPProtocol.java +++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/IsoTPProtocol.java @@ -75,7 +75,7 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> } @Override - protected void encode(ChannelHandlerContext ctx, Tpdu in, List<Object> out) throws Exception { + protected void encode(ChannelHandlerContext ctx, Tpdu in, List<Object> out) { logger.debug("ISO Transport Protocol Message sent"); if (in == null) { @@ -105,7 +105,9 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> enocdeError(in, buf); break; default: - logger.error("TDPU Value %s not implemented yet", in.getTpduCode().name()); + if (logger.isErrorEnabled()) { + logger.error("TDPU Value {} not implemented yet", in.getTpduCode().name()); + } return; } // Add the user-data itself. @@ -147,7 +149,7 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> } @Override - protected void decode(ChannelHandlerContext ctx, IsoOnTcpMessage in, List<Object> out) throws Exception { + protected void decode(ChannelHandlerContext ctx, IsoOnTcpMessage in, List<Object> out) { if (logger.isTraceEnabled()) { logger.trace("Got Data: {}", ByteBufUtil.hexDump(in.getUserData())); } @@ -185,7 +187,9 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> tpdu = decodeError(userData, parameters); break; default: - logger.trace("Tpdu Code %s not implemented", tpduCode.name()); + if (logger.isErrorEnabled()) { + logger.error("Tpdu Code {} not implemented", tpduCode.name()); + } break; } @@ -290,8 +294,9 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> out.writeByte(sizeParameter.getTpduSize().getCode()); break; default: - logger.error("TDPU tarameter type {} not implemented yet", - new Object[]{parameter.getType().name()}); + if (logger.isErrorEnabled()) { + logger.error("TDPU tarameter type {} not implemented yet", parameter.getType().name()); + } return; } } @@ -389,7 +394,9 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> TpduSize size = TpduSize.valueOf(out.readByte()); return new TpduSizeParameter(size); default: - logger.error("Parameter not implemented yet " + parameterCode.name()); + if (logger.isErrorEnabled()) { + logger.error("Parameter not implemented yet {}", parameterCode.name()); + } return null; } } @@ -405,7 +412,9 @@ public class IsoTPProtocol extends MessageToMessageCodec<IsoOnTcpMessage, Tpdu> case CALLED_TSAP: return new CalledTsapParameter(deviceGroup, rackId, slotId); default: - logger.error("Parameter not implemented yet " + parameterCode.name()); + if (logger.isErrorEnabled()) { + logger.error("Parameter not implemented yet {}", parameterCode.name()); + } return null; } } -- To stop receiving notification emails like this one, please contact "commits@plc4x.apache.org" <commits@plc4x.apache.org>.