feat: allow configuration of log level
1 file changed, 3 insertions(+), 1 deletion(-)
changed files
M import/main.go → import/main.go
@@ -20,7 +20,8 @@ const timeout = 30 * time.Minute type Config struct { - ConfigFile string `conf:"short:c"` + ConfigFile string `conf:"short:c"` + LogLevel slog.Level `conf:"default:INFO"` } func main() {@@ -36,6 +37,7 @@ os.Exit(1) } log.Panicf("parsing runtime configuration: %v", err) } + slog.SetLogLoggerLevel(runtimeConfig.LogLevel) cfg, err := config.GetConfig(runtimeConfig.ConfigFile) if err != nil {