This commit is contained in:
liuchangshun 2023-12-01 14:31:18 +08:00
parent 1c29af53b3
commit e287fddc48

View File

@ -1,6 +1,7 @@
package lxzap package lxzap
import ( import (
"fmt"
"net" "net"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
@ -138,3 +139,9 @@ func GinRecovery(stack bool) gin.HandlerFunc {
c.Next() c.Next()
} }
} }
func Log(msg string, c *gin.Context) {
v, _ := c.Get("X-Span-ID")
spanId := fmt.Sprintf("%v", v)
zap.L().Info("spanId:" + spanId + "log:" + msg)
}