sql/gorm: Use zerolog logger

This commit is contained in:
Tom Wiesing 2022-12-02 10:25:59 +01:00
parent 6f1ba24761
commit 7006277409
No known key found for this signature in database
6 changed files with 125 additions and 8 deletions

View file

@ -52,9 +52,13 @@ func (sql *SQL) QueryTable(ctx context.Context, silent bool, table string) (*gor
}
// gorm configuration
config := &gorm.Config{}
config := &gorm.Config{
Logger: newGormLogger(),
}
if silent {
config.Logger = logger.Default.LogMode(logger.Silent)
config.Logger = config.Logger.LogMode(logger.Silent)
} else {
config.Logger = config.Logger.LogMode(logger.Info)
}
// mysql connection