Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use github.com/Scalingo/go-utils/logger API instead of injecting logger manually in context #1024

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nsqconsumer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To be Released

* fix: Use API for github.com/go-utils/logger instead of setting logger manually in context

## v1.3.0

* feat: add a configurable log level
Expand Down
2 changes: 1 addition & 1 deletion nsqconsumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (c *nsqConsumer) nsqHandler(message *nsq.Message) (err error) {

// Ignore linter here due to the usage of string as keys in context.
//nolint:staticcheck,revive
ctx := context.WithValue(context.WithValue(context.Background(), "request_id", msg.RequestID), "logger", msgLogger)
ctx := logger.ToCtx(context.WithValue(context.Background(), "request_id", msg.RequestID), msgLogger)

if msg.At != 0 {
now := time.Now().Unix()
Expand Down
Loading