update
parent
8af9ea376b
commit
9136b5ce70
14
store/db.go
14
store/db.go
|
@ -100,14 +100,16 @@ func New(t DBTYPE) *Store {
|
|||
// Connect to db and store db connection to var DB
|
||||
func (s *Store) Connect() (db *gorm.DB, err error) {
|
||||
|
||||
// glog := logger.Default
|
||||
// if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
||||
// l.Debug().Msg("set gorm log level to info")
|
||||
// glog.LogMode(logger.Info)
|
||||
// }
|
||||
var glog logger.Interface
|
||||
if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
||||
l.Debug().Msg("set gorm log level to info")
|
||||
glog = logger.Default.LogMode(logger.Info)
|
||||
} else {
|
||||
glog = logger.Default
|
||||
}
|
||||
|
||||
s.config = &gorm.Config{
|
||||
Logger: logger.Default.LogMode(logger.Info),
|
||||
Logger: glog,
|
||||
SkipDefaultTransaction: true,
|
||||
}
|
||||
if s.Prod {
|
||||
|
|
Loading…
Reference in New Issue