mirror of
https://github.com/restic/restic.git
synced 2025-12-03 22:21:47 +00:00
debug: support roundtripper logging also for release builds
Different from debug builds do not use the eofDetectRoundTripper if logging is disabled.
This commit is contained in:
@@ -8,5 +8,9 @@ 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user