Files
gonic/server/handler/middleware_common.go
sentriz ad571ed7ab eg
2019-05-20 14:49:14 +01:00

14 lines
273 B
Go

package handler
import (
"log"
"net/http"
)
func (c *Controller) WithLogging(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
log.Printf("connection from `%s` for `%s`", r.RemoteAddr, r.URL)
next.ServeHTTP(w, r)
}
}