func (l *Logger) ModifyRequest(req *http.Request) error {
	ctx := martian.NewContext(req)
	if ctx.SkippingLogging() {
		return nil
	}
	b := &bytes.Buffer{}
	fmt.Fprintln(b, "")
	fmt.Fprintln(b, strings.Repeat("-", 80))
	fmt.Fprintf(b, "Request to %s\n", req.URL)
	fmt.Fprintln(b, strings.Repeat("-", 80))
	mv := messageview.New()
	mv.SkipBody(l.headersOnly)
	if err := mv.SnapshotRequest(req); err != nil {
		return err
	}
	var opts []messageview.Option
	if l.decode {
		opts = append(opts, messageview.Decode())
	}
	r, err := mv.Reader(opts...)
	if err != nil {
		return err
	}
	io.Copy(b, r)
	fmt.Fprintln(b, "")
	fmt.Fprintln(b, strings.Repeat("-", 80))
	l.log(b.String())
	return nil
}
ModifyRequest logs the request, optionally including the body.

The format logged is:
--------------------------------------------------------------------------------
Request to http://www.google.com/path?querystring
--------------------------------------------------------------------------------
GET /path?querystring HTTP/1.1
Host: www.google.com
Connection: close
Other-Header: values

request content
--------------------------------------------------------------------------------
package martianlog
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"strings"
	"github.com/google/martian/v3"
	"github.com/google/martian/v3/log"
	"github.com/google/martian/v3/messageview"
	"github.com/google/martian/v3/parse"
)
type Logger struct {
	log         func(line string)
	headersOnly bool
	decode      bool
}
type loggerJSON struct {
	Scope       []parse.ModifierType `json:"scope"`
	HeadersOnly bool                 `json:"headersOnly"`
	Decode      bool                 `json:"decode"`
}
func init() {
	parse.Register("log.Logger", loggerFromJSON)
}
func NewLogger() *Logger {
	return &Logger{
		log: func(line string) {
			log.Infof(line)
		},
	}
}
func (l *Logger) SetHeadersOnly(headersOnly bool) {
	l.headersOnly = headersOnly
}
func (l *Logger) SetDecode(decode bool) {
	l.decode = decode
}
func (l *Logger) SetLogFunc(logFunc func(line string)) {
	l.log = logFunc
}