mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 02:40:15 +08:00
update 打印日志
This commit is contained in:
@@ -101,19 +101,20 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
|||||||
byte[] writeMsg = Bytes.concat(head, length, temp, crc);
|
byte[] writeMsg = Bytes.concat(head, length, temp, crc);
|
||||||
// 返回完整的报文 string类型
|
// 返回完整的报文 string类型
|
||||||
String wholeMsg= BytesUtil.binary(writeMsg, 16);
|
String wholeMsg= BytesUtil.binary(writeMsg, 16);
|
||||||
log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
|
// log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
|
||||||
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
|
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
|
||||||
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
|
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
|
||||||
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
|
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
|
||||||
// 检查操作的状态
|
// 检查操作的状态
|
||||||
if (channelFutureListener.isSuccess()) {
|
if (channelFutureListener.isSuccess()) {
|
||||||
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
log.info("push结果【成功】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
|
||||||
|
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||||
} else {
|
} else {
|
||||||
// 如果发生错误,则访问描述原因的Throwable
|
// 如果发生错误,则访问描述原因的Throwable
|
||||||
Throwable cause = channelFutureListener.cause();
|
Throwable cause = channelFutureListener.cause();
|
||||||
// cause.printStackTrace();
|
log.info("push结果【失败】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
|
||||||
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||||
log.error("push发送命令失败", cause);
|
log.error("push发送命令失败, pileSn:{}", pileSn, cause);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user