Skip to content

Commit

Permalink
fix: fix bug in SetHTTPDebugLog (#857)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
  • Loading branch information
Two-Hearts committed Jan 4, 2024
1 parent 62587ae commit dc575a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/trace/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ func logHeader(header http.Header, e log.Logger) {

// SetHTTPDebugLog sets up http debug log with logrus.Logger
func SetHTTPDebugLog(ctx context.Context, authClient *auth.Client) {
if logrusLog, ok := log.GetLogger(ctx).(*logrus.Logger); ok && logrusLog.Level != logrus.DebugLevel {
if logrusLog, ok := log.GetLogger(ctx).(*logrus.Logger); !ok || logrusLog.Level != logrus.DebugLevel {
return
}
if authClient.Client == nil {
authClient.Client = http.DefaultClient
authClient.Client = &http.Client{}
}
if authClient.Client.Transport == nil {
authClient.Client.Transport = http.DefaultTransport
Expand Down

0 comments on commit dc575a6

Please sign in to comment.