We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40ee5fb commit 4a36022Copy full SHA for 4a36022
1 file changed
log/context.go
@@ -103,8 +103,7 @@ func SetFormat(format string) error {
103
// WithLogger returns a new context with the provided logger. Use in
104
// combination with logger.WithField(s) for great effect.
105
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
106
- e := logger.WithContext(ctx)
107
- return context.WithValue(ctx, loggerKey{}, e)
+ return context.WithValue(ctx, loggerKey{}, logger.WithContext(ctx))
108
}
109
110
// GetLogger retrieves the current logger from the context. If no logger is
0 commit comments