mirror of
https://github.com/octoleo/restic.git
synced 2024-11-05 04:47:51 +00:00
1ed775e3a8
Different from debug builds do not use the eofDetectRoundTripper if logging is disabled.
17 lines
453 B
Go
17 lines
453 B
Go
//go:build !debug
|
|
// +build !debug
|
|
|
|
package debug
|
|
|
|
import "net/http"
|
|
|
|
// RoundTripper returns a new http.RoundTripper which logs all requests (if
|
|
// debug is enabled). When debug is not enabled, upstream is returned.
|
|
func RoundTripper(upstream http.RoundTripper) http.RoundTripper {
|
|
if opts.isEnabled {
|
|
// only use loggingRoundTripper if the debug log is configured
|
|
return loggingRoundTripper{eofDetectRoundTripper{upstream}}
|
|
}
|
|
return upstream
|
|
}
|