logging
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

This commit is contained in:
2024-06-19 11:46:22 -04:00
parent 1b528a85c8
commit 399cfd827d
2 changed files with 17 additions and 1 deletions

15
middleware/logging.go Normal file
View File

@@ -0,0 +1,15 @@
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)
},
)
}