You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Post Terraform CLI 0.15, setting log levels outside TRACE is now considered reliable. Currently, terraform-exec hardcodes the equivalent of TF_LOG=TRACE when using (tfexec.Terraform).SetLogPath():
// Log levels other than TRACE are currently unreliable, the CLI recommends using TRACE only.
env[logEnvVar] ="TRACE"
}
Consumers, such as the terraform-plugin-sdk/v2 acceptance testing framework should be able to pass along a provider developer's desire for DEBUG or higher logs only from Terraform CLI.
Proposal
Add tfexec.Terraform type log string field.
Add (tfexec.Terraform).SetLog(string) error method, which sets the log field if Terraform CLI >= 0.15.
Update (tfexec.Terraform).SetLogPath(string) to set the log field to TRACE, unless it is already set (this will ensure SetLog() or SetLogPath() can be called in any order and preserve the previous behavior)
Update (tfexec.Terraform).buildEnv() logic to call env[logEnvVar] = tf.log instead of env[logEnvVar] = "TRACE"
Description
Post Terraform CLI 0.15, setting log levels outside TRACE is now considered reliable. Currently, terraform-exec hardcodes the equivalent of
TF_LOG=TRACE
when using(tfexec.Terraform).SetLogPath()
:terraform-exec/tfexec/cmd.go
Lines 145 to 154 in 1bbcd0b
Consumers, such as the terraform-plugin-sdk/v2 acceptance testing framework should be able to pass along a provider developer's desire for DEBUG or higher logs only from Terraform CLI.
Proposal
tfexec.Terraform
typelog string
field.(tfexec.Terraform).SetLog(string) error
method, which sets thelog
field if Terraform CLI >= 0.15.(tfexec.Terraform).SetLogPath(string)
to set thelog
field toTRACE
, unless it is already set (this will ensureSetLog()
orSetLogPath()
can be called in any order and preserve the previous behavior)(tfexec.Terraform).buildEnv()
logic to callenv[logEnvVar] = tf.log
instead ofenv[logEnvVar] = "TRACE"
References
The text was updated successfully, but these errors were encountered: