Documentation ¶
Overview ¶
Package debuglog provides a RoundTripper you can put into an HTTP client Transport to log requests made with that client. This has been proven useful for finding starr app API payloads, and as a general debug log wrapper for an integrating application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Limit logged JSON payloads to this many bytes. 0=unlimited MaxBody int // This is where logs go. If not set they go to log.Printf. Debugf func(string, ...interface{}) // This can be used for byte counters, but is optional otherwise. Caller Caller // Any strings in this list are replaced with <recated> in the log output. // Useful for hiding api keys and passwords from debug logs. String must be 4+ chars. Redact []string }
Config is the input data for the logger.
type LoggingRoundTripper ¶
type LoggingRoundTripper struct {
// contains filtered or unexported fields
}
LoggingRoundTripper allows us to use a datacounter to log http request data.
func NewLoggingRoundTripper ¶
func NewLoggingRoundTripper(config Config, next http.RoundTripper) *LoggingRoundTripper
NewLoggingRoundTripper returns a round tripper to log requests counts and response sizes.
Click to show internal directories.
Click to hide internal directories.