Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / docker / cli / cli / debug / debug.go
1 package debug
2
3 import (
4         "os"
5
6         "github.com/Sirupsen/logrus"
7 )
8
9 // Enable sets the DEBUG env var to true
10 // and makes the logger to log at debug level.
11 func Enable() {
12         os.Setenv("DEBUG", "1")
13         logrus.SetLevel(logrus.DebugLevel)
14 }
15
16 // Disable sets the DEBUG env var to false
17 // and makes the logger to log at info level.
18 func Disable() {
19         os.Setenv("DEBUG", "")
20         logrus.SetLevel(logrus.InfoLevel)
21 }
22
23 // IsEnabled checks whether the debug flag is set or not.
24 func IsEnabled() bool {
25         return os.Getenv("DEBUG") != ""
26 }