1 package middleware 2 3 import ( 4 "github.com/gin-gonic/gin" 5 "github.com/go-logr/logr" 6 7 "edge-infra.dev/pkg/lib/fog" 8 ) 9 10 // IntoContext sets the logger on the request context 11 func IntoContext(log logr.Logger) gin.HandlerFunc { 12 return func(c *gin.Context) { 13 c.Request = c.Request.Clone(fog.IntoContext(c.Request.Context(), log)) 14 c.Next() 15 } 16 } 17