segmentio / kafka-go

Kafka library in Go
MIT License
7.3k stars 760 forks source link

Feture request: logger with different levels #1281

Open iSerganov opened 2 months ago

iSerganov commented 2 months ago

As far as I can see from the README, for the moment there is only an option to provide a logger implementation that will log all internal messages of the library.

It would be very nice to have different levels of log messages, e.g.:

That will allow the caller code to choose the desirable amount of logged data depending on their need.

isaacd9 commented 2 months ago

The Reader and Writer have both a Logger (for Info level logs) and an ErrorLogger for more serious errors: https://pkg.go.dev/github.com/segmentio/kafka-go#LoggerFunc

What messages do you think should be logged at Warn or Debug OOC?

iSerganov commented 1 day ago

IMHO, log messages during rebalancing events (join group, left group, etc.), acks received from broker, should go to Debug level logger.