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

RHCLOUD-36895 | refactor: reduce logging noise #241

Merged
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion internal/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ func NewConsumerEventLoop(
case kafka.Error:
endpoints.IncConsumeErrors()
l.Log.Errorf("Consumer error: %v (%v)\n", e.Code(), e)
case kafka.OffsetsCommitted:
if e.Error != nil {
l.Log.Errorf("Unable to commit offset: %#v", e)
break
}

l.Log.Debugf("Ignored OffsetsComitted: %#v", e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making this a trace level log?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, even better. Done!


default:
l.Log.Infof("Ignored %v\n", e)
l.Log.Infof("Ignored %#v\n", e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a bit more context to this log message? Maybe something like "Ignored kafka event"? I was a bit stumped the first time I saw the original log message. It took me a minute to figure out what I was seeing getting logged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good idea too! Done!

}

}
Expand Down
Loading