diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/logging/logging.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/logging/logging.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/logging/logging.go b/vendor/github.com/hashicorp/terraform/helper/logging/logging.go index 433cd77..6bd92f7 100644 --- a/vendor/github.com/hashicorp/terraform/helper/logging/logging.go +++ b/vendor/github.com/hashicorp/terraform/helper/logging/logging.go | |||
@@ -18,7 +18,7 @@ const ( | |||
18 | EnvLogFile = "TF_LOG_PATH" // Set to a file | 18 | EnvLogFile = "TF_LOG_PATH" // Set to a file |
19 | ) | 19 | ) |
20 | 20 | ||
21 | var validLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"} | 21 | var ValidLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"} |
22 | 22 | ||
23 | // LogOutput determines where we should send logs (if anywhere) and the log level. | 23 | // LogOutput determines where we should send logs (if anywhere) and the log level. |
24 | func LogOutput() (logOutput io.Writer, err error) { | 24 | func LogOutput() (logOutput io.Writer, err error) { |
@@ -40,7 +40,7 @@ func LogOutput() (logOutput io.Writer, err error) { | |||
40 | 40 | ||
41 | // This was the default since the beginning | 41 | // This was the default since the beginning |
42 | logOutput = &logutils.LevelFilter{ | 42 | logOutput = &logutils.LevelFilter{ |
43 | Levels: validLevels, | 43 | Levels: ValidLevels, |
44 | MinLevel: logutils.LogLevel(logLevel), | 44 | MinLevel: logutils.LogLevel(logLevel), |
45 | Writer: logOutput, | 45 | Writer: logOutput, |
46 | } | 46 | } |
@@ -77,7 +77,7 @@ func LogLevel() string { | |||
77 | logLevel = strings.ToUpper(envLevel) | 77 | logLevel = strings.ToUpper(envLevel) |
78 | } else { | 78 | } else { |
79 | log.Printf("[WARN] Invalid log level: %q. Defaulting to level: TRACE. Valid levels are: %+v", | 79 | log.Printf("[WARN] Invalid log level: %q. Defaulting to level: TRACE. Valid levels are: %+v", |
80 | envLevel, validLevels) | 80 | envLevel, ValidLevels) |
81 | } | 81 | } |
82 | 82 | ||
83 | return logLevel | 83 | return logLevel |
@@ -90,7 +90,7 @@ func IsDebugOrHigher() bool { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | func isValidLogLevel(level string) bool { | 92 | func isValidLogLevel(level string) bool { |
93 | for _, l := range validLevels { | 93 | for _, l := range ValidLevels { |
94 | if strings.ToUpper(level) == string(l) { | 94 | if strings.ToUpper(level) == string(l) { |
95 | return true | 95 | return true |
96 | } | 96 | } |