1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Make Xorm log configurable (#174)

* make xorm log configable

* bug fixed for other sub commands except web

* rebase and fix xorm log

* bug fix for TrimSpace
This commit is contained in:
Lunny Xiao
2017-02-20 16:11:13 +08:00
committed by GitHub
parent d4b752def9
commit 04fdeb9d8d
5 changed files with 231 additions and 17 deletions

View File

@@ -74,6 +74,8 @@ func runCreateUser(c *cli.Context) error {
setting.NewContext()
models.LoadConfigs()
setting.NewXORMLogService(false)
if err := models.SetEngine(); err != nil {
return fmt.Errorf("models.SetEngine: %v", err)
}

View File

@@ -50,7 +50,6 @@ var CmdServ = cli.Command{
func setup(logPath string) error {
setting.NewContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
models.LoadConfigs()
if setting.UseSQLite3 || setting.UseTiDB {
@@ -60,6 +59,7 @@ func setup(logPath string) error {
}
}
setting.NewXORMLogService(true)
return models.SetEngine()
}