7 ms·
Not a Go engineer but Go-curious - shouldn’t this use slog[0] for structured logging rather than a third party?
by weakfish 1y ago
Not a Go engineer but Go-curious - shouldn’t this use slog[0] for structured logging rather than a third party?
- porjo 1y agoThe article is from 2022 which predates slog in stdlib. Article also references Wrap() & Wrapf() which are also not part of stdlib (odd they don't mention that imo).
- pstuart 1y agoIt was likely using the previous default error lib github.com/pkg/errors
- candiddevmike 1y agoDepends on if you're making a public library. Using slog is "polite" but I don't really see it as the endgame of logging libraries. It has quite a few rough edges for CLI apps, like no control on attr order. But it is zomgfast, and speed is important, right?
- jen20 1y agoThe biggest advantage is being third-party-dependency-free. I tend to reject libraries which have no updated to use the stdlib approach at this stage as “likely unmaintained” - similar for those that pull in things like pkg/errors transitively. Apps can do what they like, though.