This commit is contained in:
2025-11-05 23:52:48 +08:00
parent a1f7c09b2a
commit 5eeeeb5006
6 changed files with 51 additions and 18 deletions

View File

@@ -47,7 +47,7 @@ func (ps *PostgresStorage) Connect(ctx context.Context) error {
logger.Info("正在连接PostgreSQL数据库")
// 创建 GORM 的 logger 适配器
gormLogger := logs.NewGormLogger(logger)
gormLogger := logs.NewGormLogger(logs.GetLogger(logs.AddCompName(context.Background(), "GORM")))
var err error
// 在 gorm.Open 时传入我们自定义的 logger