From 0a1dc7236fc42399440f7edca5448286936fb305 Mon Sep 17 00:00:00 2001 From: Richard87 Date: Tue, 9 Apr 2024 13:14:20 +0200 Subject: [PATCH] print out parsed log level --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a024fe1..c8b6abd 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ func main() { ctx := context.Background() var opts Options err := envconfig.Process(ctx, &opts) - initLogger(opts) + initLogger(&opts) log.Info().Msg("Starting") log.Info().Str("ISSUER", opts.Issuer).Send() @@ -45,7 +45,7 @@ func main() { Run(ctx, opts) } -func initLogger(opts Options) { +func initLogger(opts *Options) { logLevel, err := zerolog.ParseLevel(opts.LogLevel) if err != nil { logLevel = zerolog.InfoLevel @@ -55,6 +55,7 @@ func initLogger(opts Options) { if logLevel == zerolog.NoLevel { logLevel = zerolog.InfoLevel } + opts.LogLevel = logLevel.String() var logWriter io.Writer = os.Stderr if opts.LogPretty {