Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(out io.Writer, level Level) train.Interceptor

    New returns a logging interceptor with the given level that writes to the given writer.

    Example
    Output:
    
    GET / HTTP/1.1
    Host: 127.0.0.1:54709
    User-Agent: Go-http-client/1.1
    Accept-Encoding: gzip
    
    HTTP/1.1 200 OK
    Content-Length: 13
    Content-Type: text/plain; charset=utf-8
    Date: Tue, 10 Nov 2009 23:00:00 UTC
    
    Hello World!
    

    Types

    type Level

    type Level uint8
    const (
    	// Logs nothing.
    	None Level = iota
    	// Logs request and response lines and their respective headers.
    	Basic
    	// Logs request and response lines and their respective headers and bodies (if present).
    	Body
    )

    Source Files