From 3c17c6043972501546d0a0c0281958db42ac1ac9 Mon Sep 17 00:00:00 2001 From: soxx Date: Fri, 21 Jun 2024 23:35:41 +0200 Subject: [PATCH] fix(postgres): Update postgres.go to use silent logger for GORM configuration Signed-off-by: soxx --- pkg/database/postgres.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/database/postgres.go b/pkg/database/postgres.go index 62a4d2c..ab22d85 100644 --- a/pkg/database/postgres.go +++ b/pkg/database/postgres.go @@ -14,6 +14,7 @@ import ( log "github.com/sirupsen/logrus" gormPostgres "gorm.io/driver/postgres" "gorm.io/gorm" + logger2 "gorm.io/gorm/logger" ) //go:embed migrations/*.sql @@ -42,7 +43,9 @@ func (p *postgresqlConnection) Connect(_ context.Context, endpoint string, usern 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 if err != nil { return err