MCPcopy Create free account
hub / github.com/bricks-cloud/BricksLLM / SetLogToCtx

Function SetLogToCtx

internal/util/util.go:24–26  ·  view source on GitHub ↗
(c *gin.Context, logger *zap.Logger)

Source from the content-addressed store, hash-verified

22}
23
24func SetLogToCtx(c *gin.Context, logger *zap.Logger) {
25 c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), STRING_LOG, logger))
26}
27
28func GetLogFromCtx(c *gin.Context) *zap.Logger {
29 logWithCid := c.Request.Context().Value(STRING_LOG).(*zap.Logger)

Callers 2

getMiddlewareFunction · 0.92
getAdminLoggerMiddlewareFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected