2 ms·
But you've offered no actual criteria why the API is bad! Again, most logging users want something to handle nested record contexts for them and per-level metho
by morelisp 3y ago
But you've offered no actual criteria why the API is bad! Again, most logging users want something to handle nested record contexts for them and per-level methods, most logging implementers want a minimum number of entry points, and that's exactly what this API offers. (It's definitely not zerolog-style where it sacrifices ease of use for performance.)
- kiitos 3y agoStructured logging means logging where discrete events are sets of key=val pairs, and nothing more. What is a record context? What is a level? These are concepts built on top of a structured logger, which manifest as specific key=val pairs in a given structured log event. They don't need -- and shouldn't have! -- first-order representation in a low-level structured logger API. What is an entry point? If I'm writing some structured logger implementation, I expect that I should need to provide precisely one method: func (x *MyThing) Log(<set of key=val pairs>) error Anything more is cruft.