提交 122ee309 编写于 作者: J Juergen Hoeller

Efficient log checks in STOMP encoder/decoder

上级 dd43b6aa
......@@ -160,9 +160,7 @@ public class StompDecoder {
}
}
else {
if (logger.isTraceEnabled()) {
logger.trace("Incomplete frame, resetting input buffer...");
}
logger.trace("Incomplete frame, resetting input buffer...");
if (headers != null && headerAccessor != null) {
String name = NativeMessageHeaderAccessor.NATIVE_HEADERS;
@SuppressWarnings("unchecked")
......@@ -299,7 +297,9 @@ public class StompDecoder {
contentLength = headerAccessor.getContentLength();
}
catch (NumberFormatException ex) {
logger.warn("Ignoring invalid content-length: '" + headerAccessor);
if (logger.isWarnEnabled()) {
logger.warn("Ignoring invalid content-length: '" + headerAccessor);
}
contentLength = null;
}
......
......@@ -98,9 +98,7 @@ public class StompEncoder {
DataOutputStream output = new DataOutputStream(baos);
if (SimpMessageType.HEARTBEAT.equals(SimpMessageHeaderAccessor.getMessageType(headers))) {
if (logger.isTraceEnabled()) {
logger.trace("Encoding heartbeat");
}
logger.trace("Encoding heartbeat");
output.write(StompDecoder.HEARTBEAT_PAYLOAD);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册