Initial commit

This commit is contained in:
Ria Bhatia
2017-12-04 13:32:57 -06:00
committed by Erik St. Martin
commit 0075e5b0f3
9056 changed files with 2523100 additions and 0 deletions

26
vendor/github.com/hyperhq/hypercli/utils/debug.go generated vendored Normal file
View File

@@ -0,0 +1,26 @@
package utils
import (
"os"
"github.com/Sirupsen/logrus"
)
// EnableDebug sets the DEBUG env var to true
// and makes the logger to log at debug level.
func EnableDebug() {
os.Setenv("DEBUG", "1")
logrus.SetLevel(logrus.DebugLevel)
}
// DisableDebug sets the DEBUG env var to false
// and makes the logger to log at info level.
func DisableDebug() {
os.Setenv("DEBUG", "")
logrus.SetLevel(logrus.InfoLevel)
}
// IsDebugEnabled checks whether the debug flag is set or not.
func IsDebugEnabled() bool {
return os.Getenv("DEBUG") != ""
}