bug in log level setup
This commit is contained in:
+2
-3
@@ -351,10 +351,9 @@ func logScanner(ctx context.Context, lf *amLogFile, done chan bool) {
|
|||||||
// SetupLogging sets up the log file based on the configuration data.
|
// SetupLogging sets up the log file based on the configuration data.
|
||||||
func SetupLogging() func() {
|
func SetupLogging() func() {
|
||||||
loglevel, err := log.ParseLevel(config.GlobalComputedConfig.LogLevel)
|
loglevel, err := log.ParseLevel(config.GlobalComputedConfig.LogLevel)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
loglevel = log.ErrorLevel
|
|
||||||
} else {
|
|
||||||
log.Errorf("default log level not valid: %s (%v)", config.GlobalComputedConfig.LogLevel, err)
|
log.Errorf("default log level not valid: %s (%v)", config.GlobalComputedConfig.LogLevel, err)
|
||||||
|
loglevel = log.ErrorLevel
|
||||||
}
|
}
|
||||||
if config.GlobalComputedConfig.DebugMode && loglevel != log.TraceLevel {
|
if config.GlobalComputedConfig.DebugMode && loglevel != log.TraceLevel {
|
||||||
loglevel = log.DebugLevel
|
loglevel = log.DebugLevel
|
||||||
|
|||||||
Reference in New Issue
Block a user