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