Skip to content

Commit

Permalink
Add default context logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Mar 7, 2024
1 parent 08e43b8 commit 00d6625
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ SQL_PORT=
CRON_SCHEDULE=
SCHEDULE_NODE_SYNC=
SCHEDULE_POD_SYNC=
APP_NAME_EXCLUDE_LIST=
APP_NAME_EXCLUDE_LIST=
PRETTY_PRINT=1
LOG_LEVEL=trace
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func setupLogger(ctx context.Context, logLevel string, prettyPrint bool) (contex
if prettyPrint {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.TimeOnly})
}
zerolog.DefaultContextLogger = &log.Logger
ctx = log.Logger.WithContext(ctx)
return ctx, nil
}

0 comments on commit 00d6625

Please sign in to comment.