12 lines
269 B
Go
12 lines
269 B
Go
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func (m *Middleware) Log(next http.HandlerFunc) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
m.l.Infof("[%s] \"%s %s\"", r.Context().Value(RequestIDKey), r.Method, r.URL.Path)
|
|
next(w, r)
|
|
}
|
|
}
|