/
left76
/
ccli6
Обзор
Документация
Войти
/
left76
/
ccli6
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
cli/debug/debug.go
26 строк
517 B
Simon Ferquel
updated vendoring
02 сен 2017, 02:41
02 сен 2017, 02:41
a0113c3
Код
Авторство
О чём код?
package debug import ( "os" "github.com/sirupsen/logrus" ) // Enable sets the DEBUG env var to true // and makes the logger to log at debug level. func Enable() { os.Setenv("DEBUG", "1") logrus.SetLevel(logrus.DebugLevel) } // Disable sets the DEBUG env var to false // and makes the logger to log at info level. func Disable() { os.Setenv("DEBUG", "") logrus.SetLevel(logrus.InfoLevel) } // IsEnabled checks whether the debug flag is set or not. func IsEnabled() bool { return os.Getenv("DEBUG") != "" }