▲ | ImJasonH 2 days ago | |
We had the same annoyance, and wrote https://pkg.go.dev/github.com/chainguard-dev/clog/gcp to bridge the gap. It's a slog handler that formats everything the way GCP wants, including with trace contexts, etc. We've had this in production for months, and it's been pretty great. You can add this at your main.go
(the rest of the library is about attaching a logger to a context.Context, but you don't need to use that to use the GCP logger) |