mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
Remove the default console logger when it is not set in the configuration (#602)
* Remove the default console logger when it is not set in the configuration * Added comment to new function (lint failure) * update based on PR comments (code style) * code style fix (thanks bkcsoft) * check if logger exists based on the l.outputs (like in l.DelLogger) instead of adapter, otherwise panic when reinstalling gitea (since the output adapter still exist, without outputs)
This commit is contained in:
1 parent
d1006150fb
commit
8c2c7b802f
2 files changed
+21
No files matched your search
@@ -895,6 +895,16 @@ func newLogService() {
|
||||
LogModes = strings.Split(Cfg.Section("log").Key("MODE").MustString("console"), ",")
|
||||
LogConfigs = make([]string, len(LogModes))
|
||||
|
||||
useConsole := false
|
||||
for _, mode := range LogModes {
|
||||
if mode == "console" {
|
||||
useConsole = true
|
||||
}
|
||||
}
|
||||
if (!useConsole) {
|
||||
log.DelLogger("console")
|
||||
}
|
||||
|
||||
for i, mode := range LogModes {
|
||||
mode = strings.TrimSpace(mode)
|
||||
|
||||
|
||||
Reference in new issue
Block a user