slash-init commented on code in PR #3379:
URL: https://github.com/apache/iggy/pull/3379#discussion_r3334449030
##########
foreign/go/client/iggy_client.go:
##########
@@ -72,15 +82,24 @@ func NewIggyClient(options ...Option) (iggcon.Client,
error) {
opt(&opts)
}
+ logger := opts.logger
+ if logger == nil {
+ logger = iggcon.NopLogger()
+ }
+
+ // Prepend the logger option so transport inherits it.
+ tcpOpts := append([]tcp.Option{tcp.WithLogger(logger)},
opts.tcpOptions...)
Review Comment:
I went with the documentation approach for now and clarified the behavior of
`WithLogger(...)` vs `tcp.WithLogger(...)`. `WithLogger(...)` remains the
client-level logger used by heartbeat logging and is forwarded to the transport
as a default, while an explicit `tcp.WithLogger(...)` only overrides the
transport logger.
--
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]