diff --git a/log/context.go b/log/context.go index dbf967984..ab9f50132 100644 --- a/log/context.go +++ b/log/context.go @@ -103,8 +103,7 @@ func SetFormat(format string) error { // WithLogger returns a new context with the provided logger. Use in // combination with logger.WithField(s) for great effect. func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context { - e := logger.WithContext(ctx) - return context.WithValue(ctx, loggerKey{}, e) + return context.WithValue(ctx, loggerKey{}, logger.WithContext(ctx)) } // GetLogger retrieves the current logger from the context. If no logger is