terratest
terratest copied to clipboard
Question: how to suppress log from retry.go:91
Hi Team, all
Even logger is set to Discard (Logger: logger.Discard
) in terraformOptions, we still see below output in console when go test. Any suggestions how to suppress them?
TestStandardCase 2021-09-14T15:46:34+08:00 retry.go:91: terraform [output -no-color -json]
TestFifoCase 2021-09-14T15:46:34+08:00 retry.go:91: terraform [output -no-color -json]
TestStandardCase 2021-09-14T15:46:35+08:00 retry.go:91: terraform [workspace list]
TestFifoCase 2021-09-14T15:46:35+08:00 retry.go:91: terraform [workspace list]
TestStandardCase 2021-09-14T15:46:36+08:00 retry.go:91: terraform [workspace select default]
TestFifoCase 2021-09-14T15:46:36+08:00 retry.go:91: terraform [workspace select default]
TestStandardCase 2021-09-14T15:46:37+08:00 retry.go:91: terraform [workspace show]
TestFifoCase 2021-09-14T15:46:37+08:00 retry.go:91: terraform [workspace show]
TestStandardCase 2021-09-14T15:46:38+08:00 retry.go:91: terraform [init -upgrade=false]
TestFifoCase 2021-09-14T15:46:38+08:00 retry.go:91: terraform [init -upgrade=false]
...
TestFifoCase 2021-09-14T15:49:55+08:00 sqs.go:206: Message id 144f75e2-c634-426c-9461-zzzzzzzz sent to queue https://sqs.x.amazonaws.com/y/demo-demo-oneinoneout.fifo
We currently don't support a way to suppress them in a nice way, as these functions are logging from the Logf
function directly in the logger
package, and not using the newer Logger
object.
A PR to update the retry
functions to support passing through a Logger
object would be appreciated!
Hi @yorinasub17
I would like to pick this up and implement these changes. My question though is what is the preferred behavior:
- Changing the last argument for all functions in the
retry
package from anonymous function to some newstruct
calledAction
where we could provide logger instance and fallback tologger.Default
when missing (going further we could encapsulate by this action not only the function but also other arguments as well) - Adding additional argument with the logger function
- Maybe just changing
logging.Logf
tologging.Default.Logf
? - Something else?