allow debug mode from ENV or config.

This commit is contained in:
Miroslav Šedivý 2021-01-17 19:10:59 +01:00
parent ac7200c630
commit 46c05aa49f

View File

@ -104,6 +104,11 @@ func init() {
} }
} }
// debug mode from ENV or config
if viper.GetBool("debug") {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
}
file := viper.ConfigFileUsed() file := viper.ConfigFileUsed()
logger := log.With(). logger := log.With().
Bool("debug", viper.GetBool("debug")). Bool("debug", viper.GetBool("debug")).