From bf8e35e16857b5fd8237c5b705466ede13ae2259 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 5 May 2022 16:13:45 +0800 Subject: [PATCH] log change --- internal/msg_gateway/gate/rpc_server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index a088303cb..9e738d1a0 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -56,7 +56,7 @@ func (r *RPCServer) run() { } } func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgReq) (*pbRelay.OnlinePushMsgResp, error) { - log.InfoByKv("PushMsgToUser is arriving", in.OperationID, "args", in.String()) + log.NewInfo(in.OperationID, "PushMsgToUser is arriving", in.String()) var resp []*pbRelay.SingleMsgToUser msgBytes, _ := proto.Marshal(in.MsgData) mReply := Resp{ @@ -93,7 +93,7 @@ func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgRe } } if !tag { - log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String()) + log.NewDebug(in.OperationID, "push err ,no matched ws conn not in map", in.String()) } return &pbRelay.OnlinePushMsgResp{ Resp: resp, @@ -130,12 +130,12 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm, RecvID string) (ResultCode int64) { err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { - log.ErrorByKv("PushMsgToUser is failed By Ws", "", "Addr", conn.RemoteAddr().String(), + log.NewError(in.OperationID, "PushMsgToUser is failed By Ws", "Addr", conn.RemoteAddr().String(), "error", err, "senderPlatform", constant.PlatformIDToName(in.MsgData.SenderPlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) ResultCode = -2 return ResultCode } else { - log.InfoByKv("PushMsgToUser is success By Ws", in.OperationID, "args", in.String(), "recvPlatForm", RecvPlatForm, "recvID", RecvID) + log.NewDebug(in.OperationID, "PushMsgToUser is success By Ws", "args", in.String(), "recvPlatForm", RecvPlatForm, "recvID", RecvID) ResultCode = 0 return ResultCode }