From fc1425b79795c17d37e1b68ac1a1952b039a3824 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Mon, 15 May 2023 16:42:26 +0800 Subject: [PATCH] friend --- internal/rpc/friend/friend.go | 2 ++ pkg/common/mw/rpc_server_interceptor.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go index 8b7031cf2..54e7e3573 100644 --- a/internal/rpc/friend/friend.go +++ b/internal/rpc/friend/friend.go @@ -222,6 +222,8 @@ func (s *friendServer) GetPaginationFriendsApplyFrom(ctx context.Context, req *p if err != nil { return nil, err } + log.ZInfo(ctx, "test log out") + log.ZInfo(ctx, "GetPaginationFriendsApplyFrom.xxx", "total", total, "friendRequests", len(friendRequests), "userRpcClient", s.userRpcClient == nil) resp.FriendRequests, err = convert.FriendRequestDB2Pb(ctx, friendRequests, s.userRpcClient.GetUsersInfoMap) if err != nil { return nil, err diff --git a/pkg/common/mw/rpc_server_interceptor.go b/pkg/common/mw/rpc_server_interceptor.go index a891bc100..c416c584e 100644 --- a/pkg/common/mw/rpc_server_interceptor.go +++ b/pkg/common/mw/rpc_server_interceptor.go @@ -33,7 +33,7 @@ func RpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary defer func() { if r := recover(); r != nil { log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r) - fmt.Println("stack info:", string(debug.Stack())) + fmt.Printf("panic: %+v\nstack info: %s\n", r, string(debug.Stack())) pc, file, line, ok := runtime.Caller(4) if !ok { panic("get runtime.Caller failed")