diff --git a/api/client/info.go b/api/client/info.go index 432ccac40f..06a6f0ec54 100644 --- a/api/client/info.go +++ b/api/client/info.go @@ -3,7 +3,6 @@ package client import ( "encoding/json" "fmt" - "os" "github.com/docker/docker/api/types" flag "github.com/docker/docker/pkg/mflag" @@ -45,9 +44,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error { fmt.Fprintf(cli.out, "Name: %s\n", info.Name) fmt.Fprintf(cli.out, "ID: %s\n", info.ID) - if info.Debug || os.Getenv("DEBUG") != "" { + if info.Debug { fmt.Fprintf(cli.out, "Debug mode (server): %v\n", info.Debug) - fmt.Fprintf(cli.out, "Debug mode (client): %v\n", os.Getenv("DEBUG") != "") fmt.Fprintf(cli.out, "File Descriptors: %d\n", info.NFd) fmt.Fprintf(cli.out, "Goroutines: %d\n", info.NGoroutines) fmt.Fprintf(cli.out, "System Time: %s\n", info.SystemTime) diff --git a/docker/docker.go b/docker/docker.go index 1096b840f8..0fc08ad7f9 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -52,11 +52,8 @@ func main() { setLogLevel(logrus.InfoLevel) } - // -D, --debug, -l/--log-level=debug processing - // When/if -D is removed this block can be deleted if *flDebug { os.Setenv("DEBUG", "1") - setLogLevel(logrus.DebugLevel) } if len(flHosts) == 0 { diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index e099995ad3..98bcd1ad21 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -229,8 +229,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagD(c *check.C) { c.Fatal(err) } content, _ := ioutil.ReadFile(s.d.logFile.Name()) - if !strings.Contains(string(content), `level=debug`) { - c.Fatalf(`Missing level="debug" in log file using -D:\n%s`, string(content)) + if strings.Contains(string(content), `level=debug`) { + c.Fatalf(`Should not have level="debug" in log file using -D:\n%s`, string(content)) } } @@ -239,8 +239,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagDebug(c *check.C) { c.Fatal(err) } content, _ := ioutil.ReadFile(s.d.logFile.Name()) - if !strings.Contains(string(content), `level=debug`) { - c.Fatalf(`Missing level="debug" in log file using --debug:\n%s`, string(content)) + if strings.Contains(string(content), `level=debug`) { + c.Fatalf(`Should not have level="debug" in log file using --debug:\n%s`, string(content)) } } @@ -249,8 +249,8 @@ func (s *DockerDaemonSuite) TestDaemonFlagDebugLogLevelFatal(c *check.C) { c.Fatal(err) } content, _ := ioutil.ReadFile(s.d.logFile.Name()) - if !strings.Contains(string(content), `level=debug`) { - c.Fatalf(`Missing 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 not have level="debug" in log file when using both --debug and --log-level=fatal:\n%s`, string(content)) } }