13 lines
290 B
Go
13 lines
290 B
Go
package routes
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func Logger(handler http.Handler, logger *log.Logger) http.HandlerFunc {
|
|
return func(res http.ResponseWriter, req *http.Request) {
|
|
logger.Printf("%-30s %-10s %s", req.RemoteAddr, req.Method, req.URL.Path)
|
|
handler.ServeHTTP(res, req)
|
|
}
|
|
}
|