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

@@ -1,11 +1,11 @@
package audio
import (
"game-driver/pkg/logger"
"github.com/gopxl/beep/v2"
"github.com/gopxl/beep/v2/mp3"
"github.com/gopxl/beep/v2/speaker"
"io"
"log"
)
func PlayBgmMP3(r io.ReadCloser, opts ...beep.LoopOption) (*beep.Ctrl, func() error) {
@@ -16,7 +16,7 @@ func PlayBgmMP3(r io.ReadCloser, opts ...beep.LoopOption) (*beep.Ctrl, func() er
loop2, err := beep.Loop2(streamer, opts...)
if err != nil {
log.Println("循环播放异常: ", err)
logger.Infoln("循环播放异常: ", err)
return nil, streamer.Close
}

View File

@@ -2,12 +2,12 @@ package audio
import (
"context"
"game-driver/pkg/logger"
"github.com/gopxl/beep/v2"
"github.com/gopxl/beep/v2/mp3"
"github.com/gopxl/beep/v2/speaker"
"github.com/gopxl/beep/v2/wav"
"io"
"log"
"time"
)
@@ -18,7 +18,7 @@ func init() {
if err != nil {
panic("扬声器初始化异常: " + err.Error())
}
log.Println("扬声器初始化完成")
logger.Infoln("扬声器初始化完成")
}
func PlayWav(c context.Context, r io.Reader) {