Michael Thomson 399cfd827d
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/dryrun Pipeline was successful
ci/woodpecker/push/publish-tag Pipeline was successful
ci/woodpecker/push/publish-latest Pipeline was successful
logging
2024-06-19 11:46:22 -04:00

16 lines
285 B
Go

package middleware
import (
"log"
"net/http"
)
func LoggingMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
log.Printf("[%s] %s", r.Method, r.URL.EscapedPath())
next.ServeHTTP(w, r)
},
)
}