CI / test (push) Successful in 1m12s
LogHandler and HTTPTransport now delegate to NewTraceHandler and NewHTTPTransport. HTTPMiddleware keeps its v1.0.0 metric names but shares responseWriter and normalizeMethod with NewHTTPMiddleware. The package example shows obsx.New. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 lines
349 B
Go
11 lines
349 B
Go
package obsx
|
|
|
|
import "log/slog"
|
|
|
|
// LogHandler wraps h so that records logged with a context carrying a span
|
|
// (slog.InfoContext and friends) get trace_id and span_id attributes,
|
|
// linking logs to traces.
|
|
//
|
|
// Deprecated: use NewTraceHandler, which LogHandler now calls.
|
|
func LogHandler(h slog.Handler) slog.Handler { return NewTraceHandler(h) }
|