完成日志输出到文件、终端多处的处理
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"game-driver/internal/schema"
|
||||
"game-driver/leaf"
|
||||
"game-driver/pkg/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
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 {
|
||||
logger.Panicln("报文解析错误", err)
|
||||
zap.S().Panicln("报文解析错误", err)
|
||||
}
|
||||
leaf.WithValue[*T](c, PayloadJSONKey, pm)
|
||||
c.Next()
|
||||
|
||||
Reference in New Issue
Block a user