浏览代码

Merge pull request #13221 from duglin/ReenableDebug

add link between -D and --log-level=debug back in
Alexander Morozov 10 年之前
父节点
当前提交
0db7365c66
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 1 0
      docker/docker.go
  2. 6 6
      integration-cli/docker_cli_daemon_test.go

+ 1 - 0
docker/docker.go

@@ -56,6 +56,7 @@ func main() {
 
 
 	if *flDebug {
 	if *flDebug {
 		os.Setenv("DEBUG", "1")
 		os.Setenv("DEBUG", "1")
+		setLogLevel(logrus.DebugLevel)
 	}
 	}
 
 
 	if len(flHosts) == 0 {
 	if len(flHosts) == 0 {

+ 6 - 6
integration-cli/docker_cli_daemon_test.go

@@ -232,8 +232,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagD(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
-	if strings.Contains(string(content), `level=debug`) {
-		c.Fatalf(`Should not have level="debug" in log file using -D:\n%s`, string(content))
+	if !strings.Contains(string(content), `level=debug`) {
+		c.Fatalf(`Should have level="debug" in log file using -D:\n%s`, string(content))
 	}
 	}
 }
 }
 
 
@@ -242,8 +242,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagDebug(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
-	if strings.Contains(string(content), `level=debug`) {
-		c.Fatalf(`Should not have level="debug" in log file using --debug:\n%s`, string(content))
+	if !strings.Contains(string(content), `level=debug`) {
+		c.Fatalf(`Should have level="debug" in log file using --debug:\n%s`, string(content))
 	}
 	}
 }
 }
 
 
@@ -252,8 +252,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagDebugLogLevelFatal(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
 	content, _ := ioutil.ReadFile(s.d.logFile.Name())
-	if strings.Contains(string(content), `level=debug`) {
-		c.Fatalf(`Should not have level="debug" in log file when using both --debug and --log-level=fatal:\n%s`, string(content))
+	if !strings.Contains(string(content), `level=debug`) {
+		c.Fatalf(`Should have level="debug" in log file when using both --debug and --log-level=fatal:\n%s`, string(content))
 	}
 	}
 }
 }