diff options
author | a1012112796 <1012112796@qq.com> | 2021-03-29 03:08:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 20:08:19 +0100 |
commit | 3273fb9af18b9356d3c472bf23e9fbb8c7d681f3 (patch) | |
tree | 1860c24521269946d558ec60d521fc91a04f9c39 /routers | |
parent | 82d1a7fb17ea549b17ef30711e0fa7e136acb880 (diff) | |
download | gitea-3273fb9af18b9356d3c472bf23e9fbb8c7d681f3.tar.gz gitea-3273fb9af18b9356d3c472bf23e9fbb8c7d681f3.zip |
use level config in main section when subsection not set level (#15176)
in previouse if a log subsetcion not set level
it will use ``info`` as default value.
this pr will make default value (``[log] -> LEVEL``) useable.
example config:
```INI
[log]
MODE = console
LEVEL = Trace
[log.console]
LEVEL =
STDERR = false
```
previous result:
```JSON
// console:
{
"level": "info",
...................
}
```
after change:
```JSON
// console:
{
"level": "track",
...................
}
```
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/install.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install.go b/routers/install.go index 7f01738efe..1af72f2a04 100644 --- a/routers/install.go +++ b/routers/install.go @@ -373,7 +373,7 @@ func InstallPost(ctx *context.Context) { cfg.Section("session").Key("PROVIDER").SetValue("file") cfg.Section("log").Key("MODE").SetValue("console") - cfg.Section("log").Key("LEVEL").SetValue(setting.LogLevel) + cfg.Section("log").Key("LEVEL").SetValue(setting.LogLevel.String()) cfg.Section("log").Key("ROOT_PATH").SetValue(form.LogRootPath) cfg.Section("log").Key("ROUTER").SetValue("console") |