master
Evan Chen 2022-01-09 03:33:48 +08:00
parent e15d29b758
commit db40830da2
1 changed files with 7 additions and 1 deletions

View File

@ -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 {