Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit f8674c1

Browse files
author
Julien Pivotto
authored
Enable request/response logging (#34)
This makes debugging for developers & users of this provider easier by exposing all requests & responses in the log (when >DEBUG severity is set). Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
1 parent cb64b31 commit f8674c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sdk/vra7_client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ import (
66
"encoding/json"
77
"fmt"
88
"net/http"
9+
10+
"github.com/hashicorp/terraform/helper/logging"
911
)
1012

1113
// NewClient creates a new APIClient object
1214
func NewClient(user, password, tenant, baseURL string, insecure bool) APIClient {
1315

14-
transport := http.DefaultTransport.(*http.Transport)
15-
transport.TLSClientConfig = &tls.Config{
16+
t := http.DefaultTransport.(*http.Transport)
17+
t.TLSClientConfig = &tls.Config{
1618
InsecureSkipVerify: insecure,
1719
}
20+
transport := logging.NewTransport("VRA7", t)
1821
httpClient := &http.Client{
1922
// Timeout: clientTimeout,
2023
Transport: transport,

0 commit comments

Comments
 (0)