Commit 6021514e by tiger

日志调整

1 parent 67284dc7
......@@ -64,8 +64,6 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
protected void channelRead0(ChannelHandlerContext ctx, byte[] bytes) throws Exception {
String ip = TcpServer.getIp(ctx);
log.info("【{}】up: {}", ip, ByteUtils.toHex(bytes));
// 收到的rsp或者notify
try {
TcpBase<TcpData> up = Ocpp16Helper.parse(bytes);
......@@ -76,7 +74,8 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
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();
if (handlerClass == null && up instanceof TcpReq) {
......@@ -93,7 +92,9 @@ public class TcpServerHandler extends SimpleChannelInboundHandler<byte[]> {
if (rsp != null) {
byte[] rspBytes = Ocpp16Helper.build(rsp);
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) {
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!