commands/http: Log incoming requests (with DEBUG log level)
Matt Bell committed
Nov 6, 2014 at 17:11 UTC
3df5202f8a36d3654018f033f33b63cc73774a12
1 file changed
+5
commands/http/handler.go
+5
@@ -6,8 +6,11 @@ import (
6
"net/http"
7
8
cmds "github.com/jbenet/go-ipfs/commands"
9
+ u "github.com/jbenet/go-ipfs/util"
10
)
11
12
+var log = u.Logger("commands/http")
13
+
14
type Handler struct {
15
ctx cmds.Context
16
root *cmds.Command
@@ -26,6 +29,8 @@ func NewHandler(ctx cmds.Context, root *cmds.Command) *Handler {
29
}
30
31
func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
32
+ log.Debug("Incoming API request: ", r.URL)
33
+
34
req, err := Parse(r, i.root)
35
if err != nil {
36
if err == ErrNotFound {