Skip to content

Commit

Permalink
fix: wire up metal-go for HTTP debug logging
Browse files Browse the repository at this point in the history
At some point I switched the metal-go client creation function
to use `logging.NewSubsystemLoggingHTTPTransport` instead of
the deprecated `logging.NewTransport` that is used elsewhere.

However, I missed that `logging.NewSubsystemLoggingHTTPTransport`
requires creating a subsystem first; since I didn't create a new
subsystem, the metal-go HTTP debug logs were silently dropped.

This reverts to the `logging.NewTransport` to fix logging and
match how we set up other clients.  We can explicitly work on
dropping use of the deprecated function at a later time.
  • Loading branch information
ctreatma committed Sep 7, 2023
1 parent 5cf6d50 commit 396d0ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion equinix/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (c *Config) NewMetalClient() *packngo.Client {
// NewMetalGoClient returns a new metal-go client for accessing Equinix Metal's API.
func (c *Config) NewMetalGoClient() *metalv1.APIClient {
transport := http.DefaultTransport
transport = logging.NewSubsystemLoggingHTTPTransport("Equinix Metal (metal-go)", transport)
transport = logging.NewTransport("Equinix Metal (metal-go)", transport)
retryClient := retryablehttp.NewClient()
retryClient.HTTPClient.Transport = transport
retryClient.RetryMax = c.MaxRetries
Expand Down

0 comments on commit 396d0ad

Please sign in to comment.