From 99d5507b223baa6c780707d32c7bbbb8611034f0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 18:24:58 +0200 Subject: feat: allow configuration of log level --- import/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'import') diff --git a/import/main.go b/import/main.go index b8ae633..87f8e4d 100644 --- a/import/main.go +++ b/import/main.go @@ -20,7 +20,8 @@ import ( 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 @@ func main() { } log.Panicf("parsing runtime configuration: %v", err) } + slog.SetLogLoggerLevel(runtimeConfig.LogLevel) cfg, err := config.GetConfig(runtimeConfig.ConfigFile) if err != nil { -- cgit 1.4.1