提交 3df5202f 作者: Matt Bell 提交者: Juan Batiz-Benet

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

上级 7ead6607
......@@ -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 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论