commands/http: Log incoming requests (with DEBUG log level)

This commit is contained in:
Matt Bell 2014-11-06 17:11:11 -08:00 committed by Juan Batiz-Benet
parent 7ead660738
commit 3df5202f8a

View File

@ -6,8 +6,11 @@ import (
"net/http"
cmds "github.com/jbenet/go-ipfs/commands"
u "github.com/jbenet/go-ipfs/util"
)
var log = u.Logger("commands/http")
type Handler struct {
ctx cmds.Context
root *cmds.Command
@ -26,6 +29,8 @@ func NewHandler(ctx cmds.Context, root *cmds.Command) *Handler {
}
func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Debug("Incoming API request: ", r.URL)
req, err := Parse(r, i.root)
if err != nil {
if err == ErrNotFound {