3 ms·
Libraries generally shouldn't depend on concrete loggers. Plumbing a logging interface throughout is a marginal improvement, but really they should provide a a
by xyzzy_plugh 7y ago
Libraries 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.