mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
17 lines
307 B
Go
17 lines
307 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
func loggingMiddleware(h http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(os.Stdout, "%v \"%s %s\"\n",
|
|
time.Now().Format(time.RFC3339), r.Method, r.URL)
|
|
h.ServeHTTP(w, r)
|
|
})
|
|
}
|