From 7038e08dbc194a4cb3ff9eeba621da84d5828ce8 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Sat, 14 Oct 2023 16:04:59 +0800 Subject: [PATCH] chore: pkg import only once Signed-off-by: guoguangwu --- internal/logging/logging.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/logging/logging.go b/internal/logging/logging.go index ace140a92..ccde7b483 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -11,7 +11,6 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" "github.com/pkg/errors" "github.com/sirupsen/logrus" - log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -38,7 +37,7 @@ func UnaryServerCtxIDInterceptor(ctx context.Context, req interface{}, info *grp // set id to context and add as logrus field ctx = context.WithValue(ctx, ContextIDKey, ctxID) - ctxlogrus.AddFields(ctx, log.Fields{ + ctxlogrus.AddFields(ctx, logrus.Fields{ "ctx_id": ctxID, }) @@ -69,7 +68,7 @@ func UnaryClientCtxIDInterceptor(ctx context.Context, method string, req, reply logFields := clientLoggerFields(ctx, method, reply, err, code, startTime, header) // log api call - levelLogf(log.WithFields(logFields), level, "finished client unary call") + levelLogf(logrus.WithFields(logFields), level, "finished client unary call") return err }