diff --git a/main.go b/main.go index 11f4ee5..eb09986 100644 --- a/main.go +++ b/main.go @@ -128,7 +128,7 @@ func main() { viper.AutomaticEnv() viper.SetEnvPrefix("ts") - // Commandline over-rides config file for debugging + // Enable debug mode if specified by commandline argument, regardless of what is in config file if *flagDebugOn { viper.Set("Debug", true) log.SetLevel(log.TraceLevel) @@ -182,6 +182,11 @@ func main() { } } + // enable debug mode if specified in config file, even if not specified by commandline argument + if viper.GetBool("Debug") == true { + log.SetLevel(log.TraceLevel) + } + basePath := viper.GetString("BasePath") log.Infof("Serving HTTP at %s/", formatBaseURL(fmt.Sprintf("http://%s:%d", viper.GetString("HttpHost"), viper.GetInt("HttpPort")), basePath))