Log redirector now respects TF_LOG #1772
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change all logs emitted with
log.Printf
were sent to Pulumi as DEBUG-level logs, making it difficult to detect errors and warnings emitted in this way, or to filter verbose logs to find errors or warnings.Fixes #1632
The are two changes:
bridged providers will continue to send these logs as DEBUG-level logs by default but will now attach the original level label to the message, so that filtering verbose logs is easier
if the user sets the TF_LOG environment variable to an appropriate value such as TF_LOG=WARN, these logs will be sent to Pulumi at their correct level and will be made visible by Pulumi CLI
The TF_LOG-gated behavior matches Terraform behavior where seeing logs in the CLI is opt-in and disabled by default.