gistfile1.txt
· 249 B · Text
Sin formato
import "github.com/felixge/httpsnoop"
wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
metrics := httpsnoop.CaptureMetrics(handler, w, r)
slog.Info(fmt.Sprintf("%v %v", r.Method, r.URL), "code", metrics.Code)
})
| 1 | import "github.com/felixge/httpsnoop" |
| 2 | |
| 3 | wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 4 | metrics := httpsnoop.CaptureMetrics(handler, w, r) |
| 5 | slog.Info(fmt.Sprintf("%v %v", r.Method, r.URL), "code", metrics.Code) |
| 6 | }) |