mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 23:08:07 +08:00
commands/http: Log incoming requests (with DEBUG log level)
This commit is contained in:
parent
7ead660738
commit
3df5202f8a
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user