2 ms·
To guarantee correctness, you must use the strongly-typed slog.Attr helpers. They make it impossible to create an unbalanced pair by catching errors at compile
by tptacek 1y ago
To guarantee correctness, you must use the strongly-typed slog.Attr helpers. They make it impossible to create an unbalanced pair by catching errors at compile time
I take their point, but given the typical value of most logging lines, this does not seem worth the tax you pay in readability. This is a gripe I have with oTel too --- it really cruds your code up --- but with oTel you're getting long-term value that logging (which is still my go-to o11y) doesn't.
- arccy 1y agoOTel have logging too... https://pkg.go.dev/go.opentelemetry.io/otel/log https://pkg.go.dev/go.opentelemetry.io/otel/log and even a slog bridge https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelslog https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otels...