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
import (
"fmt"
"net"
"net/http"
"net/http/httputil"
@ -138,3 +139,9 @@ func GinRecovery(stack bool) gin.HandlerFunc {
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)
}