antonbabenko/pre-commit-terraform

Introduce log levels and move unneeded logs to `debug` log level

brettcurtis opened this issue · 2 comments

Describe the bug

Seeing duplicate or unclear output in regards to Success! The configuration is valid.

Command 'terraform init' successfully done: regional/infra
Success! The configuration is valid.

Success! The configuration is valid.

How can we reproduce it?

gh repo clone osinfra-io/google-cloud-networking
cd google-cloud-networking
 find . -name ".terraform.lock.hcl" | xargs rm -rf
 find . -name ".terraform" | xargs rm -rf
pre-commit run -a

Okay, need to add a DEBUG log level, set log level to INFO by default, and move mostly all of these logs to the DEBUG lvl

image

Another example of unneeded logs are when tflint installs plugins on multiple directories when there is a failure.

Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 2

Command 'tflint --init' successfully done:
Installing plugins on each working directory...

====================================================
working directory: example0

Plugin "aws" is already installed
====================================================
working directory: example1

Plugin "aws" is already installed
...