Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLoggedTransport = NewLoggedTransport(http.DefaultTransport, DefaultLogger{})
DefaultLoggedTransport wraps http.DefaultTransport to log using DefaultLogger
Functions ¶
func NewLoggedTransport ¶
func NewLoggedTransport(rt http.RoundTripper, log HTTPLogger) http.RoundTripper
NewLoggedTransport takes an http.RoundTripper and returns a new one that logs requests and responses
Types ¶
type DefaultLogger ¶
type DefaultLogger struct { }
DefaultLogger is an http logger that will use the standard logger in the log package to provide basic information about http responses
func (DefaultLogger) LogRequest ¶
func (dl DefaultLogger) LogRequest(*http.Request)
LogRequest doens't do anything since we'll be logging replies only
func (DefaultLogger) LogResponse ¶
func (dl DefaultLogger) LogResponse(req *http.Request, res *http.Response, err error, duration time.Duration)
LogResponse logs path, host, status code and duration in milliseconds