fix(postgres): Update postgres.go to use silent logger for GORM configuration

Signed-off-by: soxx <soxx@fenpa.ws>
This commit is contained in:
SoXX 2024-06-21 23:35:41 +02:00
parent c07fd69f4f
commit 3c17c60439

View File

@ -14,6 +14,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
gormPostgres "gorm.io/driver/postgres" gormPostgres "gorm.io/driver/postgres"
"gorm.io/gorm" "gorm.io/gorm"
logger2 "gorm.io/gorm/logger"
) )
//go:embed migrations/*.sql //go:embed migrations/*.sql
@ -42,7 +43,9 @@ func (p *postgresqlConnection) Connect(_ context.Context, endpoint string, usern
log.Infof("OtterSpace: migration compleate") log.Infof("OtterSpace: migration compleate")
db, err := gorm.Open(gormPostgres.Open(dsn), &gorm.Config{}) db, err := gorm.Open(gormPostgres.Open(dsn), &gorm.Config{
Logger: logger2.Default.LogMode(logger2.Silent),
})
p.db = db p.db = db
if err != nil { if err != nil {
return err return err