kafka-go
kafka-go copied to clipboard
logger: ensure compatibility with new log/slog package
The API for the logger changes only slightly and should continue to be backwards compatible for any existing code.
I've fixed everything with CircleCI except the linters; the error message on the linter is incomprehensible.
I've fixed everything with CircleCI except the linters; the error message on the linter is incomprehensible.
If you'd prefer I can handle the Go version upgrade and linting fixes. Then this PR will just be the change you actually want to make. Let me know what's best for you
If you'd prefer I can handle the Go version upgrade and linting fixes.
Sure, if you have time that would be great.
I'm not sure this compatibility makes sense - Printf
accepts a formatting string and values for the placeholders but slog
expects key/value pairs after the first argument and does not do any placeholder substitution.
For example:
https://github.com/segmentio/kafka-go/blob/ebca72eaee918d303c532feb7ff29afdcd8c2efa/reader.go#L274
Will cause the following to be logged when using the slog
backend:
2009/11/10 23:00:00 INFO started commit for group %s
!BADKEY=my-group