From 04580e467217ba0a853584692e753d1c09df4e71 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 4 Nov 2021 03:45:06 +0800 Subject: [PATCH] fix: log level and log prod not affected --- configui.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configui.go b/configui.go index 482fd4e..83bcb7c 100644 --- a/configui.go +++ b/configui.go @@ -124,6 +124,7 @@ func (cui *ConfigUI) LoadConfig(confstr string) error { cui.Files = tmpConf.Files cui.AllowIP = tmpConf.AllowIP cui.Prod = tmpConf.Prod + klog.PROD = cui.Prod cui.ConfigPath = tmpConf.ConfigPath cui.HideConfig = tmpConf.HideConfig cui.NoReconfig = tmpConf.NoReconfig @@ -153,6 +154,10 @@ func (cui *ConfigUI) LoadConfig(confstr string) error { cui.ResultBellow = tmpConf.ResultBellow cui.LogLevel = tmpConf.LogLevel + if cui.LogLevel == 0 { + cui.LogLevel = klog.Lerror | klog.Linfo + } + klog.LEVEL = cui.LogLevel cui.LogPath = tmpConf.LogPath cui.setLog() // fmt.Printf("%+v", cui)