slash-init commented on code in PR #3379:
URL: https://github.com/apache/iggy/pull/3379#discussion_r3360598397


##########
foreign/go/client/iggy_client.go:
##########
@@ -54,8 +56,19 @@ func WithTcp(tcpOpts ...tcp.Option) Option {
        }
 }
 
+// WithLogger sets the logger for the Iggy client and its underlying transport.
+// This logger is used by the heartbeat and forwarded to the transport as a
+// default. When no logger is provided, all internal log output is silently
+// discarded.
+func WithLogger(logger *slog.Logger) Option {
+       return func(opts *Options) {
+               opts.logger = logger
+       }
+}
+

Review Comment:
   > `WithLogger(nil)` will stores a nil `*slog.Logger`, overwriting the 
`DiscardHandler` default from `GetDefaultOptions`. This nil propagates to both 
`IggyClient.logger` and `IggyTcpClient.logger`.
   
   Thanks for pointing this out. I've made the requested changes.



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