go-guerrilla icon indicating copy to clipboard operation
go-guerrilla copied to clipboard

Logger

Open lcges opened this issue 7 years ago • 1 comments

Hi. You have a great product!! But I did not find the possibility to change the Logger. You use: sirupsen/logrus and my: /uber-go/zap, for this I need to point to a Journal.

Do you have any solution?

lcges avatar Feb 22 '18 10:02 lcges

Thanks, glad you like it. So far, all the logging stuff has been contained to its own internal log package which is the only place that imports logrus, so if one wanted to replace it then they would only need to work on that package. Of course, that would not be the ideal way, but still something

The problem is that all the different golang log libraries don't share a common standard interface, so the solution would be to design a standard interface and then make an adapter for each one, similar to the way the SQL package has all the different database drivers, at the cost of not being able to use specific features to each logger package. That itself could be a big task. After a quick Google there seems to be an example which uses adapters approach here https://goa.design/implement/logging/

flashmob avatar Mar 09 '18 03:03 flashmob