diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-21 21:34:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 21:34:05 +0800 |
commit | 70ae6d197b28f018264798b07a16bf3acc36405c (patch) | |
tree | 9e4e197a5dddc3b29c5f849beee1c8b7f9ae84fc /modules | |
parent | ffde33bdfabceb69ac2bdf43466cc0508fec0add (diff) | |
download | gitea-70ae6d197b28f018264798b07a16bf3acc36405c.tar.gz gitea-70ae6d197b28f018264798b07a16bf3acc36405c.zip |
disable console output xorm log on ssh (#993)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index e69cfaa320..fbb283a9da 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -958,7 +958,6 @@ func newLogService() { for i, mode := range LogModes { sec, err := Cfg.GetSection("log." + mode) - if err != nil { sec, _ = Cfg.NewSection("log." + mode) } @@ -1025,9 +1024,10 @@ func NewXORMLogService(disableConsole bool) { if disableConsole && mode == "console" { continue } + sec, err := Cfg.GetSection("log." + mode) if err != nil { - log.Fatal(4, "Unknown log mode: %s", mode) + sec, _ = Cfg.NewSection("log." + mode) } validLevels := []string{"Trace", "Debug", "Info", "Warn", "Error", "Critical"} @@ -1079,7 +1079,9 @@ func NewXORMLogService(disableConsole bool) { } log.NewXORMLogger(Cfg.Section("log").Key("BUFFER_LEN").MustInt64(10000), mode, logConfigs) - log.Info("XORM Log Mode: %s(%s)", strings.Title(mode), levelName) + if !disableConsole { + log.Info("XORM Log Mode: %s(%s)", strings.Title(mode), levelName) + } var lvl core.LogLevel switch levelName { |