chengxilo commented on code in PR #3379:
URL: https://github.com/apache/iggy/pull/3379#discussion_r3338730789


##########
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:
   Another approach would be remove `tcp.WithLogger`, and change the signature 
of `NewTcpClient` to
   `func NewIggyTcpClient(logger *slog.Logger, options ...Option) 
*IggyTcpClient`. logger actually is not a optional parameter, we always use 
`NewIggyClient` to create TCP client, and we always provide a logger to it. 
This is actually better than document it.



-- 
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]

Reply via email to