5 ms·
While we can debate all day long what should and should not be part of the standard lib (bike shed), I just ignore all of this and happily use zerolog. Problem
by latchkey 4y ago
While we can debate all day long what should and should not be part of the standard lib (bike shed), I just ignore all of this and happily use zerolog.
Problem solved, one dependency, it just works. Back to writing code.
- tptacek 4y agoThe proposal acknowledges that. Part of the point of working this out is that it creates a common interface so that your zerolog-logging code plays nice with someone else's hclog-logging code.
- oezi 4y agoUnless the new generic logging API is designed badly so that certain functionalities become hard in the future because they deviate. For instance when Rails did standardize ActiveJob (background tasks) they didn't include a way in the API to query the current length of a queue of background tasks. Because everyone is now only trying to conform to the API accessing such information is now hard in many of the implementations.
- latchkey 4y agoA long time ago, I was part of JSR-47. I wonder if anything can be learned from that process (which was a bit of a mess).
- jen20 4y agoThe problem is, it's not one dependency. Several important libraries pull in a variety of wrappers and adapters - just to name three: - glog (gRPC) - logr (OpenTelemetry and friends) - klog (Kubernetes client) It's quite conceivable that even having decided to use zerolog, you end up with at least four separate logging libraries in your dependency tree before having written any of your own code.
- latchkey 4y agoTrue, but as long as I can either control the logging or write an adapter, I'm ok with that. At the end of the day, I'd still have that issue, unless the standard lib was being used everywhere... which is something that is equally not controllable.
- jen20 4y agoThe hope of a standard structured logging interface in the standard library is that serious libraries will adapt themselves to use it, and the proliferation will disappear over time. Whether or not this will actually happen, or whether the libraries which do not play ball will have to be forked is a different matter.
- latchkey 4y ago"serious" libraries today all provide the ability to pass in adapters. Having been in the group of a multi-year effort to do this in Java (JSR-47), there is always a limitation in the API that prevents someone from getting it right. Funny enough, even though Java ended up with JUL (java.util.logging), SLF4J ended up being the defacto standard that everyone went with.
- jen20 4y ago> "serious" libraries today all provide the ability to pass in adapters. Sadly they don't, unless we count things like gRPC, Kubernetes clients and so forth as non-serious.