完成日志输出到文件、终端多处的处理

This commit is contained in:
2024-11-13 16:11:59 +08:00
parent 9b643f4352
commit 28291598bb
28 changed files with 175 additions and 330 deletions

View File

@@ -5,7 +5,7 @@
package leaf
import (
"game-driver/pkg/logger"
"go.uber.org/zap"
"io"
)
@@ -35,7 +35,7 @@ func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc {
return func(c *Context) {
defer func() {
if err := recover(); err != nil {
logger.Infoln("执行出错: ", err)
zap.S().Errorln("执行出错: ", err)
handle(c, err)
}
}()