fixed: 修复sql日志无法加入统一zap输出的bug

This commit is contained in:
piexlMax(奇淼
2024-12-25 13:51:02 +08:00
parent cb23254152
commit 8b93ede959
2 changed files with 9 additions and 11 deletions
+1 -3
View File
@@ -6,8 +6,6 @@ import (
"gorm.io/gorm"
"gorm.io/gorm/logger"
"gorm.io/gorm/schema"
"log"
"os"
"time"
)
@@ -34,7 +32,7 @@ func (g *_gorm) Config(prefix string, singular bool) *gorm.Config {
general = global.GVA_CONFIG.Mysql.GeneralDB
}
return &gorm.Config{
Logger: logger.New(NewWriter(general, log.New(os.Stdout, "\r\n", log.LstdFlags)), logger.Config{
Logger: logger.New(NewWriter(general), logger.Config{
SlowThreshold: 200 * time.Millisecond,
LogLevel: general.LogLevel(),
Colorful: true,