wolfstudy commented on issue #12: package logrus for project URL: https://github.com/apache/pulsar-client-go/pull/12#issuecomment-493293651 1. Use logrus lib print: ``` time="2019-05-17T09:58:37+08:00" level=info msg="hello logrus" ``` 2. Printed log information after rewriting the `Formatter`: ``` 2019/05/17 10:00:25.530 test.go:9: [info] hello log ``` Users may prefer to see the form of this kind of log output below, which is why I am overriding the `Formatter` method. 3. Use logrus's `WithFiled` to print: ``` name := "pulsar" logrus.WithField("name", name).Info("hello pulsar name") ``` output: ``` time="2019-05-17T10:06:09+08:00" level=info msg="hello pulsar name" name=pulsar ``` 4. Print using a packaged library: ``` func main() { name := "pulsar" logutil.Infof("hello pulsar name: %s", name) } ``` output: ``` 2019/05/17 10:09:17.905 test.go:9: [info] hello pulsar name: pulsar ```
---------------------------------------------------------------- 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] With regards, Apache Git Services
