Skip to content

Commit

Permalink
print out parsed log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Apr 9, 2024
1 parent 2077c1c commit 0a1dc72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 0a1dc72

Please sign in to comment.