python-terraform icon indicating copy to clipboard operation
python-terraform copied to clipboard

Provide a way to set TF_LOG and TF_LOG_PATH

Open mpagot opened this issue 3 years ago • 2 comments

https://www.terraform.io/internals/debugging

Terraform support logging to file and controlling log verbosity using environment variables. Allow them to be controlled/enabled by python.

mpagot avatar Jul 21 '22 06:07 mpagot

I think you can set it if you pass is_env_vars_included=True

e.g.

export TF_LOG=trace
export TF_LOG_PATH=/path/to/log/file.log
python3 your_code.py
tf = Terraform(..., is_env_vars_included=True)

eliorerz avatar Oct 26 '22 11:10 eliorerz

thanks about is_env_vars_included I like to include python-terraform in a python cli, and I like the user to control verbosity with a cli argument (better to say I like an already existing --verbose argument to also control the verbosity of the Terraform part)

mpagot avatar Oct 26 '22 11:10 mpagot