全面替换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

@@ -5,8 +5,8 @@
package leaf
import (
"game-driver/pkg/logger"
"io"
"log"
)
// RecoveryFunc defines the function passable to CustomRecovery.
@@ -35,7 +35,7 @@ func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc {
return func(c *Context) {
defer func() {
if err := recover(); err != nil {
log.Println("执行出错: ", err)
logger.Infoln("执行出错: ", err)
handle(c, err)
}
}()