Skip to content

Commit 3740147

Browse files
committed
lint: codeql: fix various
1 parent 247613e commit 3740147

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/http/httputilmore/http_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package httputilmore
22

33
import (
4-
"log"
4+
"log/slog"
55
"net/http"
66
"time"
77
)
@@ -12,7 +12,7 @@ import (
1212
// From: https://groups.google.com/forum/#!topic/golang-nuts/s7Xk1q0LSU0
1313
func Log(handler http.Handler) http.Handler {
1414
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
15-
log.Printf("%s %s %s", r.RemoteAddr, r.Method, r.URL)
15+
slog.Info("log handler func", "remote-addr", r.RemoteAddr, "req-method", r.Method, "req-url", r.URL)
1616
handler.ServeHTTP(w, r)
1717
})
1818
}

0 commit comments

Comments
 (0)