diff --git a/logger/logger.go b/logger/logger.go index eb813ec..d6784d0 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -12,8 +12,8 @@ type contextKey string const loggerKey contextKey = "logger" const errorLoggerKey contextKey = "errorLogger" -// NewContextWithLogger creates a new context with a zerolog logger for stdout adn stderr and sets the global log level. -func NewContextWithLogger(ctx context.Context, logLevel string) context.Context { +// AddLoggerToContext creates a new context with a zerolog logger for stdout adn stderr and sets the global log level. +func AddLoggerToContext(ctx context.Context, logLevel string) context.Context { // Set log level to configured value switch logLevel { case "debug": diff --git a/main.go b/main.go index c9bc433..c717d49 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,7 @@ func run() error { g, ctx := errgroup.WithContext(ctx) logLevel := viper.GetString("log_level") - ctx = logger.NewContextWithLogger(ctx, logLevel) + ctx = logger.AddLoggerToContext(ctx, logLevel) log := logger.FromContext(ctx) errLog := logger.ErrorLoggerFromContext(ctx)