4 ms·
I personally think they missed one big pain point of Go: the logging. The standard logging should be an interface for structured logs that can be implemented by
by Sytten 7y ago
I personally think they missed one big pain point of Go: the logging. The standard logging should be an interface for structured logs that can be implemented by various vendors instead of the current really basic logger. This is especially bad for third party libraries that either force you to use one logging library (logrus, zap, etc) or built their own custom interface which you then have to implement yourself for your logger.
That is something they should have stolen from Java...
- xyzzy_plugh 7y agoLibraries generally shouldn't depend on concrete loggers. Plumbing a logging interface throughout is a marginal improvement, but really they should provide a a structured tracing interface to let callers decide what events they care about, and how to act on that information. For example, the httptrace package provides a set of hooks you can opt in to for various http events. That being said I've only ever experienced a lot of pain when libraries use a global logger. Otherwise it's usually pretty painless to adapt one logging library to another.