Commit 6021514e by tiger

日志调整

1 parent 67284dc7
...@@ -64,8 +64,6 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> { ...@@ -64,8 +64,6 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
protected void channelRead0(ChannelHandlerContext ctx, byte[] bytes) throws Exception { protected void channelRead0(ChannelHandlerContext ctx, byte[] bytes) throws Exception {
String ip = TcpServer.getIp(ctx); String ip = TcpServer.getIp(ctx);
log.info("【{}】up: {}", ip, ByteUtils.toHex(bytes));
// 收到的rsp或者notify // 收到的rsp或者notify
try { try {
TcpBase<TcpData> up = Ocpp16Helper.parse(bytes); TcpBase<TcpData> up = Ocpp16Helper.parse(bytes);
...@@ -76,7 +74,8 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> { ...@@ -76,7 +74,8 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
return; return;
} }
log.info("up:{}", up); log.info("【{}】【{}】recv1: {}", ip, up.getClass().getSimpleName(), ByteUtils.toHex(bytes));
log.info("【{}】【{}】recv2: {}", ip, up.getClass().getSimpleName(), up);
Class<? extends TcpHandler> handlerClass = mapper.getHandlerClass(); Class<? extends TcpHandler> handlerClass = mapper.getHandlerClass();
if (handlerClass == null && up instanceof TcpReq) { if (handlerClass == null && up instanceof TcpReq) {
...@@ -93,7 +92,9 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> { ...@@ -93,7 +92,9 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
if (rsp != null) { if (rsp != null) {
byte[] rspBytes = Ocpp16Helper.build(rsp); byte[] rspBytes = Ocpp16Helper.build(rsp);
ctx.channel().writeAndFlush(rspBytes); ctx.channel().writeAndFlush(rspBytes);
log.info("【{}】send: {}", ip, rsp);
log.info("【{}】【{}】send1: {} ", ip, rsp.getClass().getSimpleName(), ByteUtils.toHex(rspBytes));
log.info("【{}】【{}】send2: {} ", ip, rsp.getClass().getSimpleName(), rsp);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("【{}】{}", ip, e); log.error("【{}】{}", ip, e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!