update
parent
750261a05e
commit
8af9ea376b
16
store/db.go
16
store/db.go
|
@ -100,18 +100,14 @@ 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
|
// glog := logger.Default
|
||||||
l.Trace().
|
// if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
||||||
// Int("level", viper.GetInt("log.level")).
|
// l.Debug().Msg("set gorm log level to info")
|
||||||
// Bool("tog_info", (zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel)).
|
// glog.LogMode(logger.Info)
|
||||||
Msgf("log level %v", viper.GetInt("log.level"))
|
// }
|
||||||
if zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel {
|
|
||||||
l.Debug().Msg("set gorm log level to info")
|
|
||||||
glog.LogMode(logger.Info)
|
|
||||||
}
|
|
||||||
|
|
||||||
s.config = &gorm.Config{
|
s.config = &gorm.Config{
|
||||||
Logger: glog,
|
Logger: logger.Default.LogMode(logger.Info),
|
||||||
SkipDefaultTransaction: true,
|
SkipDefaultTransaction: true,
|
||||||
}
|
}
|
||||||
if s.Prod {
|
if s.Prod {
|
||||||
|
|
Loading…
Reference in New Issue