diff --git a/backend/init/db/db.go b/backend/init/db/db.go index 64b67b3f4..4f081c37f 100644 --- a/backend/init/db/db.go +++ b/backend/init/db/db.go @@ -2,6 +2,8 @@ package db import ( "fmt" + "gorm.io/gorm/logger" + "log" "os" "time" @@ -24,8 +26,19 @@ func Init() { } } + newLogger := logger.New( + log.New(os.Stdout, "\r\n", log.LstdFlags), + logger.Config{ + SlowThreshold: time.Second, + LogLevel: logger.Silent, + IgnoreRecordNotFoundError: true, + Colorful: false, + }, + ) + db, err := gorm.Open(sqlite.Open(fullPath), &gorm.Config{ DisableForeignKeyConstraintWhenMigrating: true, + Logger: newLogger, }) if err != nil { panic(err)