You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/09/23 12:22:55 UTC

[GitHub] [pulsar-client-go] faceair opened a new issue #370: Use dependency injection for log or use channel to expose

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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370#issuecomment-705942036


   @faceair the #323 already merged into master, please help to check the feature.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] faceair commented on issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
faceair commented on issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370#issuecomment-706061827


   Thank you very much. That's very nice. 👍


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370#issuecomment-705924277






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] faceair closed issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
faceair closed issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370#issuecomment-705924277


   @faceair Good ideas, the https://github.com/apache/pulsar-client-go/pull/323 is trying to fix this.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] faceair commented on issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
faceair commented on issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370#issuecomment-706061827


   Thank you very much. That's very nice. 👍


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] faceair closed issue #370: Use dependency injection for log or use channel to expose

Posted by GitBox <gi...@apache.org>.
faceair closed issue #370:
URL: https://github.com/apache/pulsar-client-go/issues/370


   


----------------------------------------------------------------
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:
users@infra.apache.org