slash-init commented on code in PR #3379:
URL: https://github.com/apache/iggy/pull/3379#discussion_r3334543298
##########
foreign/go/client/iggy_client.go:
##########
@@ -110,7 +129,7 @@ func (ic *IggyClient) Connect(ctx context.Context) error {
case <-ticker.C:
pingCtx, pingCancel :=
context.WithTimeout(lifetimeCtx, ic.heartbeatInterval/2)
if err := ic.Ping(pingCtx); err != nil {
- log.Printf("[WARN] heartbeat
failed: %v", err)
+ ic.logger.Warn("heartbeat
failed", "err", err)
Review Comment:
Pushed the requested changes.
* `NopLogger` uses `slog.DiscardHandler` (zero formatting, zero alloc)
* dropped `NewStderrLogger` and its test
* flipped `NewLogger` to `(writer, level)` and added doc comments
* added a nil guard on the logger at the top of `CheckAndRedirectToLeader`
* documented the `WithLogger` / `tcp.WithLogger` split on `WithTcp`,
`WithLogger`, and `tcp.WithLogger`
* changed the heartbeat key to `"error"` for consistency with
`leader_aware.go`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]