-
Notifications
You must be signed in to change notification settings - Fork 10
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
Some good logging #525
Some good logging #525
Conversation
WalkthroughThis pull request updates the error logging and method signatures in the sync worker. The changes introduce structured logging using Changes
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 golangci-lint (1.62.2)Error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24) 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
pkg/sync/syncWorker.go (2)
333-336
: Consider utilizing or removing the unused context parameter.The context parameter is marked as unused (
_
). If it's not needed, consider removing it from the signature. If it might be needed in the future, add a TODO comment explaining the intended use.-func (s *syncWorker) listenToStream( - _ context.Context, - node registry.Node, - originatorStream *originatorStream, -) error { +func (s *syncWorker) listenToStream( + node registry.Node, + originatorStream *originatorStream, +) error {
276-276
: Use structured logging consistently.Replace
fmt.Sprintf
with zap's structured logging for consistency with the rest of the codebase.- s.log.Debug(fmt.Sprintf("Successfully opened a connection to peer at %s", node.HttpAddress)) + s.log.Debug("Successfully opened a connection to peer", zap.String("peer", node.HttpAddress))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/sync/syncWorker.go
(8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test (Node)
- GitHub Check: Build pre-baked anvil-xmtpd
- GitHub Check: Lint-Go
🔇 Additional comments (3)
pkg/sync/syncWorker.go (3)
166-166
: Great enhancement to error logging!The structured logging with
zap
and inclusion ofnodeid
improves error traceability.
184-189
: Excellent addition of node address in connection logs!The inclusion of
HttpAddress
in both success and error scenarios provides valuable context for network debugging.
309-318
: Well-structured error logging for subscription failures!The enhanced error logging with peer address provides better context for debugging subscription issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good logging is immediately approved always.
Needed these to determine what is going on in the network.
Summary by CodeRabbit