Skip to content
This repository was archived by the owner on May 15, 2021. It is now read-only.

Commit 359029b

Browse files
author
Seraphim R.P
committed
Disable GORM logging during tests.
1 parent 26d789a commit 359029b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
"gorm.io/driver/postgres"
3030
"gorm.io/gorm"
31+
gLog "gorm.io/gorm/logger"
3132
"gorm.io/gorm/schema"
3233

3334
"golang.org/x/crypto/acme/autocert"
@@ -101,6 +102,9 @@ func SetupApp(isTest bool) (*fiber.App, *models.Config) {
101102
if !isTest {
102103
// Fetch book names.
103104
namefetcher.FetchBookNames(config.APIBibleKey, config.IsDryRun, false)
105+
106+
// Make sure that gorm's logger is disabled during testing.
107+
gormConfig.Logger = gLog.Default.LogMode(gLog.Silent)
104108
}
105109

106110
// Connect to database and include it in the config.

0 commit comments

Comments
 (0)