mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log * add util.SplitString to handle space and/or comma-separated config lines * go fmt
This commit is contained in:
committed by
Torkel Ödegaard
parent
d085aaad41
commit
b489e93d94
@@ -15,6 +15,8 @@ import (
|
||||
"github.com/go-stack/stack"
|
||||
"github.com/inconshreveable/log15"
|
||||
"github.com/inconshreveable/log15/term"
|
||||
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
var Root log15.Logger
|
||||
@@ -172,7 +174,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) {
|
||||
Close()
|
||||
|
||||
defaultLevelName, _ := getLogLevelFromConfig("log", "info", cfg)
|
||||
defaultFilters := getFilters(cfg.Section("log").Key("filters").Strings(" "))
|
||||
defaultFilters := getFilters(util.SplitString(cfg.Section("log").Key("filters").String()))
|
||||
|
||||
handlers := make([]log15.Handler, 0)
|
||||
|
||||
@@ -185,7 +187,7 @@ func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) {
|
||||
|
||||
// Log level.
|
||||
_, level := getLogLevelFromConfig("log."+mode, defaultLevelName, cfg)
|
||||
modeFilters := getFilters(sec.Key("filters").Strings(" "))
|
||||
modeFilters := getFilters(util.SplitString(sec.Key("filters").String()))
|
||||
format := getLogFormat(sec.Key("format").MustString(""))
|
||||
|
||||
var handler log15.Handler
|
||||
|
||||
Reference in New Issue
Block a user