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

Commit 8bbfe3d

Browse files
committed
Add better logging options
1 parent 1e09180 commit 8bbfe3d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

internal/provider/provider.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,16 @@ func (p *provider) Configure(ctx context.Context, req tfsdkprovider.ConfigureReq
8181
resp.Diagnostics.AddWarning("Debug mode enabled", "Debug mode enabled, this will add the Fly-Force-Trace header to all graphql requests")
8282
}
8383

84-
// hclient := hreq.C().DevMode()
85-
hclient := hreq.C()
86-
p.httpClient = hclient
87-
88-
p.httpClient.SetCommonHeader("Authorization", "Bearer "+p.token)
89-
p.httpClient.SetTimeout(2 * time.Minute)
84+
p.httpClient = hreq.C()
9085

9186
if enableTracing {
9287
p.httpClient.SetCommonHeader("Fly-Force-Trace", "true")
88+
p.httpClient = hreq.C().DevMode()
9389
}
9490

91+
p.httpClient.SetCommonHeader("Authorization", "Bearer "+p.token)
92+
p.httpClient.SetTimeout(2 * time.Minute)
93+
9594
// TODO: Make timeout configurable
9695
h := http.Client{Timeout: 60 * time.Second, Transport: &utils.Transport{UnderlyingTransport: http.DefaultTransport, Token: token, Ctx: ctx, EnableDebugTrace: enableTracing}}
9796
client := graphql.NewClient("https://api.fly.io/graphql", &h)

0 commit comments

Comments
 (0)