From 8af9ea376b460c904ad33720812372a9c44c5f79 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Sun, 9 Jan 2022 03:44:49 +0800 Subject: [PATCH] update --- store/db.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/store/db.go b/store/db.go index da52bb1..d8e73e1 100644 --- a/store/db.go +++ b/store/db.go @@ -100,18 +100,14 @@ 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 - l.Trace(). - // Int("level", viper.GetInt("log.level")). - // Bool("tog_info", (zerolog.Level(viper.GetInt("log.level")) <= zerolog.DebugLevel)). - 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) - } + // 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) + // } s.config = &gorm.Config{ - Logger: glog, + Logger: logger.Default.LogMode(logger.Info), SkipDefaultTransaction: true, } if s.Prod {