sql/gorm: Use zerolog logger
This commit is contained in:
parent
6f1ba24761
commit
7006277409
6 changed files with 125 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue