packngo icon indicating copy to clipboard operation
packngo copied to clipboard

Disable DEBUG Logging by Default

Open rawkode opened this issue 3 years ago • 6 comments

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 😄

rawkode avatar May 24 '22 11:05 rawkode

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

displague avatar May 24 '22 14:05 displague

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 avatar May 24 '22 14:05 displague

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

displague avatar May 24 '22 14:05 displague

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 avatar May 24 '22 16:05 rawkode

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

rawkode avatar May 26 '22 18:05 rawkode

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

rawkode avatar May 26 '22 18:05 rawkode