lessmore/node/logger.go

15 lines
264 B
Go
Raw Normal View History

2017-02-13 14:31:18 +03:00
package node
import (
2018-11-06 15:53:33 +03:00
"fmt"
2017-02-13 14:31:18 +03:00
"net/http"
2018-11-06 15:53:33 +03:00
2018-11-12 15:06:39 +03:00
log "github.com/sirupsen/logrus"
2017-02-13 14:31:18 +03:00
)
// LogRequest ...
func LogRequest(r *http.Request) {
2018-11-06 15:53:33 +03:00
logString := fmt.Sprintf("%s %d %s %s", r.Method, r.ContentLength, r.RequestURI, r.RemoteAddr)
log.Print("[API] " + logString)
2017-02-13 14:31:18 +03:00
}