News for hackers. Stuff that matters.
Re:Structured Logging with Slog by bpicolo on Tuesday August 22, 2023 @04:00PM (#37227804)
As mentioned in the article, Zap's SugaredLogger has roughly the same thing https://pkg.go.dev/go.uber.org/zap

    sugar.Infow("failed to fetch URL",
      "url", "http://example.com",
      "attempt", 3,
      "backoff", time.Second,
    )
Really slog presents mostly the same two APIs as Zap, with a single entrypoint.
Re:Structured Logging with Slog by Groxx on Tuesday August 22, 2023 @07:55PM (#37230136)
`[level]w` supports both key/value pairs and individual `zap.Type(key, value)` values combined fwiw, so for that part the API is essentially the same too