github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/go-grpc-middleware/logging/zap/context.go (about) 1 package grpc_zap 2 3 import ( 4 "github.com/hxx258456/ccgo/go-grpc-middleware/logging/zap/ctxzap" 5 "github.com/hxx258456/ccgo/net/context" 6 "go.uber.org/zap" 7 "go.uber.org/zap/zapcore" 8 ) 9 10 // AddFields adds zap fields to the logger. 11 // Deprecated: should use the ctxzap.AddFields instead 12 func AddFields(ctx context.Context, fields ...zapcore.Field) { 13 ctxzap.AddFields(ctx, fields...) 14 } 15 16 // Extract takes the call-scoped Logger from grpc_zap middleware. 17 // Deprecated: should use the ctxzap.Extract instead 18 func Extract(ctx context.Context) *zap.Logger { 19 return ctxzap.Extract(ctx) 20 }