func (l *HTTPLogger) LogRequest(req *http.Request) {
	var err error
	save := req.Body
	if req.Body != nil {
		save, req.Body, err = drainBody(req.Body)
		if err != nil {
			return
		}
	}

	logrus.Tracef(
		"Request %s %s",
		req.Method,
		req.URL.String(),
	)

	for k, v := range req.Header {
		logrus.Tracef("HEADER: %s : %s\n", k, v)
	}

	var b bytes.Buffer
	if req.Body != nil {
		var dest io.Writer = &b
		_, _ = io.Copy(dest, req.Body)
	}

	blen := len(b.String())
	if b.String() == "" {
		b.WriteString("<empty body>")
	}

	req.Body = save

	logrus.Tracef("log: (%d) %s", blen, b.String())
}
// LogRequest will log the request
LogRequest will log the request
// LogRequest will log the request
func (l *HTTPLogger) LogRequest(req *http.Request) {
	var err error
	save := req.Body
	if req.Body != nil {
		save, req.Body, err = drainBody(req.Body)
		if err != nil {
			return
		}
	}
	logrus.Tracef(
		"Request %s %s",
		req.Method,
		req.URL.String(),
	)
	for k, v := range req.Header {
		logrus.Tracef("HEADER: %s : %s\n", k, v)
	}
	var b bytes.Buffer
	if req.Body != nil {
		var dest io.Writer = &b
		_, _ = io.Copy(dest, req.Body)
	}
	blen := len(b.String())
	if b.String() == "" {
		b.WriteString("<empty body>")
	}
	req.Body = save
	logrus.Tracef("log: (%d) %s", blen, b.String())
}
func ( l * HTTPLogger ) LogRequest ( req * http . Request ) { var err error save := req . Body if req . Body != nil { save , req . Body , err = drainBody ( req . Body ) if err != nil { return } } logrus . Tracef ( " " , req . Method , req . URL . String ( ) , ) for k , v := range req . Header { logrus . Tracef ( " \n " , k , v ) } var b bytes . Buffer if req . Body != nil { var dest io . Writer = & b _ , _ = io . Copy ( dest , req . Body ) } blen := len ( b . String ( ) ) if b . String ( ) == " " { b . WriteString ( " " ) } req . Body = save logrus . Tracef ( " " , blen , b . String ( ) ) }
LogRequest will log the request
LogRequest will log the request