1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package cfg import ( "net/http" sloghttp "github.com/samber/slog-http" xlog "gitlab.com/mokhax/spike/pkg/log" ) func WithMux(mux http.Handler) Option { return func(config *Config) { config.Mux = sloghttp.NewWithConfig(xlog.Logger, sloghttp.Config{ WithSpanID: true, WithTraceID: true, })(sloghttp.Recovery(mux)) } }