Merge pull request #15139 from tiborvass/fix-uuid-loggerf

Set uuid.Loggerf to nop on client and to logrus.Warnf on daemon
This commit is contained in:
Tibor Vass 2015-07-29 18:17:54 -04:00
commit 28ac78c02f
2 changed files with 9 additions and 0 deletions

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

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.")