Albirew/mangadex-next
Albirew
/
mangadex-next
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2024-03-02. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
mangadex-next/middlewares/log.go

17 lignes
333 B
Go

package middlewares
import (
"log"
"net/http"
"time"
)
func LogMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
now := time.Now()
next.ServeHTTP(w, r)
since := time.Since(now).Milliseconds
log.Printf("%v %v -- %v", r.Method, r.URL.Path, since())
})
}