switched to log.Print

This commit is contained in:
Bronku 2025-06-23 12:13:22 +02:00
parent 65709049d7
commit a98577ad18
2 changed files with 3 additions and 4 deletions

View file

@ -1,7 +1,7 @@
package logging
import (
"fmt"
"log"
"net/http"
"time"
)
@ -9,8 +9,7 @@ import (
func Middleware(in http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
fmt.Println(r.Method, r.URL.String())
in.ServeHTTP(w, r)
fmt.Println(r.Method, "finished in", time.Since(start))
log.Println(r.Method, r.URL.String(), time.Since(start))
})
}