|
@@ -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)
|
|
|
+}
|