@@ -35,8 +35,8 @@ public void encode(ChannelHandlerContext ctx, Packet packet, ByteBuf buf) {
35
35
return ;
36
36
}
37
37
38
- if (log .isDebugEnabled ()) {
39
- log .debug ("Encoding packet: {}" , packet .getClass ().getSimpleName ());
38
+ if (log .isTraceEnabled ()) {
39
+ log .trace ("Encoding packet: {}" , packet .getClass ().getSimpleName ());
40
40
}
41
41
42
42
int initial = buf .writerIndex ();
@@ -51,7 +51,9 @@ public void encode(ChannelHandlerContext ctx, Packet packet, ByteBuf buf) {
51
51
packetProtocol .getPacketHeader ().writePacketId (buf , codecHelper , packetId );
52
52
definition .getSerializer ().serialize (buf , codecHelper , packet );
53
53
54
- log .debug ("Encoded packet with id: {}" , packetId );
54
+ if (log .isDebugEnabled ()) {
55
+ log .debug ("Encoded packet {} ({})" , packet .getClass ().getSimpleName (), packetId );
56
+ }
55
57
} catch (Throwable t ) {
56
58
// Reset writer index to make sure incomplete data is not written out.
57
59
buf .writerIndex (initial );
@@ -78,7 +80,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buf, List<Object> out)
78
80
return ;
79
81
}
80
82
81
- log .debug ("Decoding packet with id: {}" , id );
83
+ log .trace ("Decoding packet with id: {}" , id );
82
84
83
85
Packet packet = this .client ? packetRegistry .createClientboundPacket (id , buf , codecHelper ) : packetRegistry .createServerboundPacket (id , buf , codecHelper );
84
86
@@ -89,7 +91,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buf, List<Object> out)
89
91
out .add (packet );
90
92
91
93
if (log .isDebugEnabled ()) {
92
- log .debug ("Decoded packet: {}" , packet .getClass ().getSimpleName ());
94
+ log .debug ("Decoded packet {} ({}) " , packet .getClass ().getSimpleName (), id );
93
95
}
94
96
} catch (Throwable t ) {
95
97
// Advance buffer to end to make sure remaining data in this packet is skipped.
0 commit comments