From faffb3a7848f86dd7ef041a244140918584e4e5a Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 5 Dec 2019 11:49:11 -0800 Subject: [PATCH] helper/logging: Warn about levels other than TRACE The filtering for other log levels is unreliable and glitchy because it's trying to infer information from the log stream that isn't reliably represented. Although the previous commit has improved the situation somewhat, it is still a tricky and unreliable heuristic, so worth a warning to anyone who is reading such a log that if they see something confusing it could be a result of the heuristic not working fully. --- helper/logging/logging.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper/logging/logging.go b/helper/logging/logging.go index e2913fa2b..f5a0ba47f 100644 --- a/helper/logging/logging.go +++ b/helper/logging/logging.go @@ -78,6 +78,9 @@ func CurrentLogLevel() string { log.Printf("[WARN] Invalid log level: %q. Defaulting to level: TRACE. Valid levels are: %+v", envLevel, ValidLevels) } + if logLevel != "TRACE" { + log.Printf("[WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.\n Use TF_LOG=TRACE to see Terraform's internal logs.\n ----") + } return logLevel }