package main

import (
	"log/slog"
	"net/http"
)

func logRequests(logger *slog.Logger, handler http.Handler) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		logger.Info("request", "method", r.Method, "url", r.URL, "remote-addr", r.RemoteAddr)
		handler.ServeHTTP(w, r)
	}
}
