зеркало из https://github.com/microsoft/docker.git
Use an environment variable to activate debug mode, instead of a package-specific flag
This commit is contained in:
Родитель
927308cfd9
Коммит
7666307931
|
@ -21,7 +21,9 @@ func main() {
|
|||
flDaemon := flag.Bool("d", false, "Daemon mode")
|
||||
flDebug := flag.Bool("D", false, "Debug mode")
|
||||
flag.Parse()
|
||||
rcli.DEBUG_FLAG = *flDebug
|
||||
if *flDebug {
|
||||
os.Setenv("DEBUG", "1")
|
||||
}
|
||||
if *flDaemon {
|
||||
if flag.NArg() != 0 {
|
||||
flag.Usage()
|
||||
|
|
2
utils.go
2
utils.go
|
@ -45,7 +45,7 @@ func Download(url string, stderr io.Writer) (*http.Response, error) {
|
|||
// Debug function, if the debug flag is set, then display. Do nothing otherwise
|
||||
// If Docker is in damon mode, also send the debug info on the socket
|
||||
func Debugf(format string, a ...interface{}) {
|
||||
if rcli.DEBUG_FLAG {
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
|
||||
// Retrieve the stack infos
|
||||
_, file, line, ok := runtime.Caller(1)
|
||||
|
|
Загрузка…
Ссылка в новой задаче