MCPcopy
hub / github.com/koderover/zadig / NewContext

Function NewContext

pkg/util/ginzap/context.go:31–33  ·  view source on GitHub ↗
(ctx *gin.Context, fields ...zapcore.Field)

Source from the content-addressed store, hash-verified

29const loggerKey = iota
30
31func NewContext(ctx *gin.Context, fields ...zapcore.Field) {
32 ctx.Set(strconv.Itoa(loggerKey), WithContext(ctx).With(fields...))
33}
34
35func WithContext(ctx *gin.Context) *zap.Logger {
36 if ctx == nil {

Callers 1

RequestIDFunction · 0.92

Calls 2

WithContextFunction · 0.85
SetMethod · 0.65

Tested by

no test coverage detected