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
|
// Connect to db and store db connection to var DB
|
||||||
func (s *Store) Connect() (db *gorm.DB, err error) {
|
func (s *Store) Connect() (db *gorm.DB, err error) {
|
||||||
|
|
||||||
// glog := logger.Default
|
var glog logger.Interface
|
||||||
// if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
||||||
// l.Debug().Msg("set gorm log level to info")
|
l.Debug().Msg("set gorm log level to info")
|
||||||
// glog.LogMode(logger.Info)
|
glog = logger.Default.LogMode(logger.Info)
|
||||||
// }
|
} else {
|
||||||
|
glog = logger.Default
|
||||||
|
}
|
||||||
|
|
||||||
s.config = &gorm.Config{
|
s.config = &gorm.Config{
|
||||||
Logger: logger.Default.LogMode(logger.Info),
|
Logger: glog,
|
||||||
SkipDefaultTransaction: true,
|
SkipDefaultTransaction: true,
|
||||||
}
|
}
|
||||||
if s.Prod {
|
if s.Prod {
|
||||||
|
|
Loading…
Reference in New Issue