grpc拦截器正式服日志记录

master
hzy 2 years ago
parent d52fc5ff6b
commit 04154053a6
  1. 2
      interceptor/v1/grpc/interceptor.go

@ -4,6 +4,7 @@ import (
"context" "context"
"gitea.drugeyes.vip/pharnexbase/utils/enum" "gitea.drugeyes.vip/pharnexbase/utils/enum"
"github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/errors"
"github.com/go-kratos/kratos/v2/log"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
@ -49,6 +50,7 @@ func (i *Interceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor {
} }
// 正式服,统一返回“服务错误” // 正式服,统一返回“服务错误”
err = ErrInternalServer err = ErrInternalServer
log.Errorf("InterServerErr:%v", se)
} }
return return
} }

Loading…
Cancel
Save