mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-19 16:51:01 -04:00
ab6c553e6b
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
26 lines
564 B
Go
26 lines
564 B
Go
package debug // import "github.com/docker/docker/cli/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") != ""
|
|
}
|