Browse Source

models: set XORM log level to WARNING in production

pull/3855/merge
Unknwon 8 years ago
parent
commit
e893e1fc63
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
  1. 7
      models/models.go

7
models/models.go

@ -178,7 +178,12 @@ func SetEngine() (err error) {
if err != nil {
return fmt.Errorf("Fail to create xorm.log: %v", err)
}
x.SetLogger(xorm.NewSimpleLogger(f))
if setting.ProdMode {
x.SetLogger(xorm.NewSimpleLogger3(f, xorm.DEFAULT_LOG_PREFIX, xorm.DEFAULT_LOG_FLAG, core.LOG_WARNING))
} else {
x.SetLogger(xorm.NewSimpleLogger(f))
}
x.ShowSQL(true)
return nil
}

Loading…
Cancel
Save