github.com/rsc/tmp@v0.0.0-20240517235954-6deaab19748b/httplogger/autolog/auto.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package autolog 6 7 import ( 8 "net/http" 9 "os" 10 11 "rsc.io/tmp/httplogger" 12 ) 13 14 func init() { 15 if os.Getenv("HTTPLOG") == "1" { 16 http.DefaultTransport = httplogger.New(http.DefaultTransport) 17 } 18 }