update 打印日志

This commit is contained in:
2023-12-15 16:35:24 +08:00
parent 589ef5777e
commit 5a905b6e79

View File

@@ -86,13 +86,15 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
}
// 处理数据
byte[] result = ykcService.process(arr, ctx.channel());
if (Objects.nonNull(result)) {
byte[] response = ykcService.process(arr, ctx.channel());
if (Objects.nonNull(response)) {
// 响应客户端
ByteBuf buffer = ctx.alloc().buffer().writeBytes(result);
ByteBuf buffer = ctx.alloc().buffer().writeBytes(response);
this.channelWrite(ctx.channel().id(), buffer);
if (!CollectionUtils.containsAny(notPrintFrameTypeList, frameType)) {
log.info("【>>>>>平台响应消息>>>>>】:{}", BytesUtil.binary(result, 16));
log.info("【>>>>>平台响应消息>>>>>】channel:{}, 帧类型:{}, 帧名称:{}, 序列号域:{}, response:{}",
ctx.channel().id(), frameType, YKCFrameTypeCode.getFrameTypeStr(frameType), serialNumber,
BytesUtil.binary(response, 16));
}
}
}