From 04fdeb9d8d4dc3cf296d8354ee29f1d053154a54 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 20 Feb 2017 16:11:13 +0800 Subject: 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 --- cmd/admin.go | 2 ++ cmd/serve.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/admin.go b/cmd/admin.go index f4782195e4..6985044243 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -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) } diff --git a/cmd/serve.go b/cmd/serve.go index c69254e3f5..7141d85c92 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -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() } -- cgit v1.2.3