equinixmetal-archive / packngo

[Deprecated] A Golang client for the Equinix Metal API. (Packet is now Equinix Metal)
https://deploy.equinix.com/labs/equinix-sdk-go/
Other
79 stars 53 forks source link

Disable DEBUG Logging by Default #335

Open rawkode opened 2 years ago

rawkode commented 2 years ago

Currently, it would appear I get DEBUG logging no matter what environment variables are set.

This is when using the Pulumi provider, via. the Terraform provider.

I have no METAL_, PACKNGO_, PACKET_, or TF_ prefixed variables set in my environment.

Please advise, @displague 😄

displague commented 2 years ago

Are the debug messages Terraform flavored or are they only from PACKNGO_DEBUG (Equinix Metal API requests and responses)?

displague commented 2 years ago

Terraform has its own request/response debugging capabilities. This may not be packngo related at all. The formatting can reveal which tool is producing the output.

https://github.com/packethost/packngo/blob/master/packngo.go#L265-L303

displague commented 2 years ago

Is this during tests? I can't find the issue, but I believe there is a Terraform issue around excessive logging (I think this was during tests).

It might help to try using the off setting for TF_LOG / TF_PROVIDER_LOG. https://github.com/hashicorp/terraform/blob/8f923cea080c531046384c9328881409b37da53c/internal/logging/logging.go#L19-L34

rawkode commented 2 years ago

Logging looks like this:

    2022/05/24 17:19:16 [DEBUG] GET https://api.equinix.com/metal/v1/ips/1ab3e425-fbdf-4051-84b6-fe371048744d
rawkode commented 2 years ago

@displague What format is this and I'll try and dig into it

rawkode commented 2 years ago

I guess Terraform, based on your link to the packngo logging?