faceair opened a new issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370
**Is your feature request related to a problem? Please describe.**
```go
import log "github.com/sirupsen/logrus"
p := &producer{
options: options,
topic: options.Topic,
client: client,
log: log.WithField("topic", options.Topic),
}
```
This uses logrus.StandardLogger to create the entry, and the output format
cannot be changed.
We don't use logrus in our business logic code, we have a custom log
collection format. Now the pulsar-client-go logs interfere with the business
logs in our process's stderr.
**Describe the solution you'd like**
We can learn sarama's error handling.
1. Define a log interface to allow user loggger injection.
[sarama.go#L106](https://github.com/Shopify/sarama/blob/v1.27.0/sarama.go#L106)
2. return errors via the error channel and let the user print their own
logs.
[consumer_group.go#L416](https://github.com/Shopify/sarama/blob/v1.27.0/consumer_group.go#L416)、[consumer_group.go#L50](https://github.com/Shopify/sarama/blob/v1.27.0/consumer_group.go#L50)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]