Documentation ¶
Overview ¶
Package httplog provides an implementation of http.RoundTripper that logs every single request and response using a given logging function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport satisfies http.RoundTripper
func NewTransport ¶
func NewTransport(rt http.RoundTripper, logBody bool, logf func(string, ...interface{})) Transport
NewTransport returns a new Transport that uses the given RoundTripper, or http.DefaultTransport if nil, and logs all requests and responses using logf, or log.Printf if nil. The body of the requests and responses are logged too only if logBody is true.
Click to show internal directories.
Click to hide internal directories.