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

Function WithContext

pkg/util/ginzap/context.go:35–45  ·  view source on GitHub ↗
(ctx *gin.Context)

Source from the content-addressed store, hash-verified

33}
34
35func WithContext(ctx *gin.Context) *zap.Logger {
36 if ctx == nil {
37 return log.Logger()
38 }
39 l, _ := ctx.Get(strconv.Itoa(loggerKey))
40 ctxLogger, ok := l.(*zap.Logger)
41 if ok {
42 return ctxLogger
43 }
44 return log.Logger()
45}

Callers 9

UpdateOperationLogStatusFunction · 0.92
GetContainerLogsSSEFunction · 0.92
ClusterApplyUpgradeFunction · 0.92
NewContextFunction · 0.92
NewContextFunction · 0.85

Calls 2

LoggerFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected