dvfs agent 0.1
This commit is contained in:
13
agent/middleware.go
Normal file
13
agent/middleware.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func logRequests(logger *slog.Logger, handler http.Handler) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
logger.Info("request", "method", r.Method, "url", r.URL, "remote-addr", r.RemoteAddr)
|
||||
handler.ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user