全面替换log为zap

This commit is contained in:
2024-11-08 18:42:13 +08:00
parent 3da1fe761e
commit edb8d30605
17 changed files with 269 additions and 55 deletions

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"game-driver/internal/schema"
"game-driver/leaf"
"log"
"game-driver/pkg/logger"
)
type JSONKey string
@@ -17,7 +17,7 @@ func PayloadJSON[T schema.JsonModel]() leaf.HandlerFunc {
pm := new(T)
err := json.Unmarshal(c.Payload, pm)
if err != nil {
log.Panicf("报文解析错误: %v\n", err)
logger.Panicf("报文解析错误: %v\n", err)
}
leaf.WithValue[*T](c, PayloadJSONKey, pm)
c.Next()