diff --git a/store/db.go b/store/db.go index f1523a9..f7ef93e 100644 --- a/store/db.go +++ b/store/db.go @@ -99,8 +99,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 + if zerolog.Level(viper.GetInt("log.level")) == zerolog.DebugLevel { + glog.LogMode(logger.Info) + } + s.config = &gorm.Config{ - Logger: logger.Default.LogMode(logger.Info), + Logger: glog, SkipDefaultTransaction: true, } if s.Prod {