diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/posener/complete/log.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/posener/complete/log.go')
-rw-r--r-- | vendor/github.com/posener/complete/log.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/posener/complete/log.go b/vendor/github.com/posener/complete/log.go new file mode 100644 index 0000000..797a80c --- /dev/null +++ b/vendor/github.com/posener/complete/log.go | |||
@@ -0,0 +1,23 @@ | |||
1 | package complete | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "io/ioutil" | ||
6 | "log" | ||
7 | "os" | ||
8 | ) | ||
9 | |||
10 | // Log is used for debugging purposes | ||
11 | // since complete is running on tab completion, it is nice to | ||
12 | // have logs to the stderr (when writing your own completer) | ||
13 | // to write logs, set the COMP_DEBUG environment variable and | ||
14 | // use complete.Log in the complete program | ||
15 | var Log = getLogger() | ||
16 | |||
17 | func getLogger() func(format string, args ...interface{}) { | ||
18 | var logfile io.Writer = ioutil.Discard | ||
19 | if os.Getenv(envDebug) != "" { | ||
20 | logfile = os.Stderr | ||
21 | } | ||
22 | return log.New(logfile, "complete ", log.Flags()).Printf | ||
23 | } | ||