You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/04/12 15:34:45 UTC
[shardingsphere] branch master updated: Remove judge of log.isDebugEnabled() (#16779)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 111d3a4e85f Remove judge of log.isDebugEnabled() (#16779)
111d3a4e85f is described below
commit 111d3a4e85f1c97a23520fd8d3af8c71ac1fab9e
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Apr 12 23:34:36 2022 +0800
Remove judge of log.isDebugEnabled() (#16779)
---
.../org/apache/shardingsphere/db/protocol/codec/PacketCodec.java | 8 ++------
.../mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java | 4 +---
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/codec/PacketCodec.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/codec/PacketCodec.java
index 0a3e356f89f..36a0274c567 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/codec/PacketCodec.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-core/src/main/java/org/apache/shardingsphere/db/protocol/codec/PacketCodec.java
@@ -42,9 +42,7 @@ public final class PacketCodec extends ByteToMessageCodec<DatabasePacket<?>> {
if (!databasePacketCodecEngine.isValidHeader(readableBytes)) {
return;
}
- if (log.isDebugEnabled()) {
- log.debug("Read from client {} :\n{}", context.channel().id().asShortText(), ByteBufUtil.prettyHexDump(in));
- }
+ log.debug("Read from client {} :\n{}", context.channel().id().asShortText(), ByteBufUtil.prettyHexDump(in));
databasePacketCodecEngine.decode(context, in, out);
}
@@ -52,8 +50,6 @@ public final class PacketCodec extends ByteToMessageCodec<DatabasePacket<?>> {
@Override
protected void encode(final ChannelHandlerContext context, final DatabasePacket<?> message, final ByteBuf out) {
databasePacketCodecEngine.encode(context, message, out);
- if (log.isDebugEnabled()) {
- log.debug("Write to client {} :\n{}", context.channel().id().asShortText(), ByteBufUtil.prettyHexDump(out));
- }
+ log.debug("Write to client {} :\n{}", context.channel().id().asShortText(), ByteBufUtil.prettyHexDump(out));
}
}
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
index d11ed31bf0a..a979734dee3 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLBinlogEventPacketDecoder.java
@@ -102,9 +102,7 @@ public final class MySQLBinlogEventPacketDecoder extends ByteToMessageDecoder {
String sqlState = payload.readStringFix(5);
throw new RuntimeException(String.format("Decode binlog event failed, errorCode: %d, sqlState: %s, errorMessage: %s", errorNo, sqlState, payload.readStringEOF()));
} else if (0 != statusCode) {
- if (log.isDebugEnabled()) {
- log.debug("Illegal binlog status code {}, remaining packet \n{}", statusCode, readRemainPacket(payload));
- }
+ log.debug("Illegal binlog status code {}, remaining packet \n{}", statusCode, readRemainPacket(payload));
}
}