mirror of
https://github.com/restic/restic.git
synced 2026-10-11 20:47:12 +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:
1 parent
38becfc436
commit
1ed775e3a8
4 files changed
+121
-116
No files matched your search
@@ -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