Closed camrossi closed 4 months ago
The log level in the config file is never read it only works if you set it as a flag.
As a quick fix I just added this after err := viper.ReadInConfig() and that fixed it
err := viper.ReadInConfig()
ll := viper.GetString("loglevel") if ll != "" { level, err := log.ParseLevel(ll) if err != nil { log.Error(fmt.Sprintf("Not supported log level - %s", err)) os.Exit(1) } log.SetLevel(level) }
Same thing for the config_dir
Fixed in commit 82e7902. Will check if any of the loglevel, logformat, logfile was set on command line, if not read from config if set else default. Command line will always have highest precedence.
The log level in the config file is never read it only works if you set it as a flag.
As a quick fix I just added this after
err := viper.ReadInConfig()
and that fixed itSame thing for the config_dir