gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-grpc-middleware/logging/logrus/context.go (about) 1 package grpc_logrus 2 3 import ( 4 "gitee.com/ks-custle/core-gm/go-grpc-middleware/logging/logrus/ctxlogrus" 5 "gitee.com/ks-custle/core-gm/net/context" 6 "github.com/sirupsen/logrus" 7 ) 8 9 // AddFields adds logrus fields to the logger. 10 // Deprecated: should use the ctxlogrus.Extract instead 11 // 12 //goland:noinspection GoUnusedExportedFunction 13 func AddFields(ctx context.Context, fields logrus.Fields) { 14 ctxlogrus.AddFields(ctx, fields) 15 } 16 17 // Extract takes the call-scoped logrus.Entry from grpc_logrus middleware. 18 // Deprecated: should use the ctxlogrus.Extract instead 19 // 20 //goland:noinspection GoUnusedExportedFunction 21 func Extract(ctx context.Context) *logrus.Entry { 22 return ctxlogrus.Extract(ctx) 23 }