Skip to content

Commit

Permalink
Merge pull request #1024 from Scalingo/fix/1023/nsqconsumer/logger
Browse files Browse the repository at this point in the history
Use github.com/Scalingo/go-utils/logger API instead of injecting logger manually in context
  • Loading branch information
leo-scalingo authored Dec 13, 2024
2 parents 55988ac + d4348c6 commit 250a4ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 250a4ab

Please sign in to comment.