Skip to content

Commit

Permalink
Facilitate log level coalescence when consuming as a library
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Dwyer <[email protected]>
  • Loading branch information
bdwyertech committed Apr 18, 2020
1 parent 24ce660 commit bec5ad2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/gontlm-proxy/gontlm-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ func Run() {
}
setGoProxyCA()
proxy := goproxy.NewProxyHttpServer()
if _, enabled := os.LookupEnv("GONTLM_PROXY_VERBOSE"); proxyVerbose || enabled {
log.SetLevel(log.DebugLevel)
if _, verbose := os.LookupEnv("GONTLM_PROXY_VERBOSE"); log.IsLevelEnabled(log.DebugLevel) || proxyVerbose || verbose {
if !log.IsLevelEnabled(log.DebugLevel) {
log.SetLevel(log.DebugLevel)
}
proxy.Verbose = true
}
dialContext := proxyplease.NewDialContext(proxyplease.Proxy{URL: proxyUrl})
Expand Down

0 comments on commit bec5ad2

Please sign in to comment.