Set uuid.Loggerf to nop on client and to logrus.Warnf on daemon

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 7841d6ab9a58aff1d607eea7303c665c159ceaec
Component: engine
This commit is contained in:
Tibor Vass
2015-07-29 17:49:59 -04:00
parent 4e9957ee2d
commit 74a4e76af0
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -10,6 +10,7 @@ import (
"os"
"strings"
"github.com/docker/distribution/uuid"
"github.com/docker/docker/cli"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/opts"
@@ -98,6 +99,10 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, clientFlags *cli.ClientF
}
cli.init = func() error {
// ignore errors from uuid package when running client commands
uuid.Loggerf = func(string, ...interface{}) {}
clientFlags.PostParse()
hosts := clientFlags.Common.Hosts
+4
View File
@@ -13,6 +13,7 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/uuid"
apiserver "github.com/docker/docker/api/server"
"github.com/docker/docker/autogen/dockerversion"
"github.com/docker/docker/cli"
@@ -154,6 +155,9 @@ func getGlobalFlag() (globalFlag *flag.Flag) {
// CmdDaemon is the daemon command, called the raw arguments after `docker daemon`.
func (cli *DaemonCli) CmdDaemon(args ...string) error {
// warn from uuid package when running the daemon
uuid.Loggerf = logrus.Warnf
if *flDaemon {
// allow legacy forms `docker -D -d` and `docker -d -D`
logrus.Warn("please use 'docker daemon' instead.")