fix: log level and log prod not affected

feat/muzan
Evan Chen 2021-11-04 03:45:06 +08:00
parent 239be22094
commit 04580e4672
1 changed files with 5 additions and 0 deletions

View File

@ -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)