Go logger interface

I wish golang had a standard logger interface (there’s a proposal for golang 2 https://github.com/golang/go/issues/28412) so that popular libraries like Zap and Logrus implemented them.

This way we can change logging libraries easily or if a library logs with logrus it shouldn’t dictate the application to use logrus (it can ask for an interface to be passed in)

I implemented a go-logger interface with two implementations (Zap and Logrus) here, https://github.com/arun0009/go-logger as I didn’t find a better alternative. Any suggestions or inputs some of you have? go-kit does something similar and that’s where I got this idea.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.