Browse code

Replace aliased imports of logrus, fixes #11762

Signed-off-by: Antonio Murdaca <me@runcom.ninja>

Antonio Murdaca authored on 2015/03/27 07:22:04
Showing 82 changed files
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"io"
6 6
 	"net/url"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/engine"
10 10
 	flag "github.com/docker/docker/pkg/mflag"
11 11
 	"github.com/docker/docker/pkg/signal"
... ...
@@ -51,7 +51,7 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
51 51
 
52 52
 	if tty && cli.isTerminalOut {
53 53
 		if err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {
54
-			log.Debugf("Error monitoring TTY size: %s", err)
54
+			logrus.Debugf("Error monitoring TTY size: %s", err)
55 55
 		}
56 56
 	}
57 57
 
... ...
@@ -17,7 +17,7 @@ import (
17 17
 	"strconv"
18 18
 	"strings"
19 19
 
20
-	log "github.com/Sirupsen/logrus"
20
+	"github.com/Sirupsen/logrus"
21 21
 	"github.com/docker/docker/api"
22 22
 	"github.com/docker/docker/graph"
23 23
 	"github.com/docker/docker/pkg/archive"
... ...
@@ -198,7 +198,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
198 198
 	// windows: show error message about modified file permissions
199 199
 	// FIXME: this is not a valid warning when the daemon is running windows. should be removed once docker engine for windows can build.
200 200
 	if runtime.GOOS == "windows" {
201
-		log.Warn(`SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
201
+		logrus.Warn(`SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
202 202
 	}
203 203
 
204 204
 	var body io.Reader
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"fmt"
6 6
 	"io"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/api/types"
10 10
 	"github.com/docker/docker/pkg/promise"
11 11
 	"github.com/docker/docker/runconfig"
... ...
@@ -67,9 +67,9 @@ func (cli *DockerCli) CmdExec(args ...string) error {
67 67
 
68 68
 	// Block the return until the chan gets closed
69 69
 	defer func() {
70
-		log.Debugf("End of CmdExec(), Waiting for hijack to finish.")
70
+		logrus.Debugf("End of CmdExec(), Waiting for hijack to finish.")
71 71
 		if _, ok := <-hijacked; ok {
72
-			log.Errorf("Hijack did not finish (chan still open)")
72
+			logrus.Errorf("Hijack did not finish (chan still open)")
73 73
 		}
74 74
 	}()
75 75
 
... ...
@@ -100,19 +100,19 @@ func (cli *DockerCli) CmdExec(args ...string) error {
100 100
 		}
101 101
 	case err := <-errCh:
102 102
 		if err != nil {
103
-			log.Debugf("Error hijack: %s", err)
103
+			logrus.Debugf("Error hijack: %s", err)
104 104
 			return err
105 105
 		}
106 106
 	}
107 107
 
108 108
 	if execConfig.Tty && cli.isTerminalIn {
109 109
 		if err := cli.monitorTtySize(execID, true); err != nil {
110
-			log.Errorf("Error monitoring TTY size: %s", err)
110
+			logrus.Errorf("Error monitoring TTY size: %s", err)
111 111
 		}
112 112
 	}
113 113
 
114 114
 	if err := <-errCh; err != nil {
115
-		log.Debugf("Error hijack: %s", err)
115
+		logrus.Debugf("Error hijack: %s", err)
116 116
 		return err
117 117
 	}
118 118
 
... ...
@@ -13,7 +13,7 @@ import (
13 13
 	"strings"
14 14
 	"time"
15 15
 
16
-	log "github.com/Sirupsen/logrus"
16
+	"github.com/Sirupsen/logrus"
17 17
 	"github.com/docker/docker/api"
18 18
 	"github.com/docker/docker/autogen/dockerversion"
19 19
 	"github.com/docker/docker/pkg/promise"
... ...
@@ -211,7 +211,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
211 211
 			} else {
212 212
 				_, err = stdcopy.StdCopy(stdout, stderr, br)
213 213
 			}
214
-			log.Debugf("[hijack] End of stdout")
214
+			logrus.Debugf("[hijack] End of stdout")
215 215
 			return err
216 216
 		})
217 217
 	}
... ...
@@ -219,14 +219,14 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
219 219
 	sendStdin := promise.Go(func() error {
220 220
 		if in != nil {
221 221
 			io.Copy(rwc, in)
222
-			log.Debugf("[hijack] End of stdin")
222
+			logrus.Debugf("[hijack] End of stdin")
223 223
 		}
224 224
 
225 225
 		if conn, ok := rwc.(interface {
226 226
 			CloseWrite() error
227 227
 		}); ok {
228 228
 			if err := conn.CloseWrite(); err != nil {
229
-				log.Debugf("Couldn't send EOF: %s", err)
229
+				logrus.Debugf("Couldn't send EOF: %s", err)
230 230
 			}
231 231
 		}
232 232
 		// Discard errors due to pipe interruption
... ...
@@ -235,14 +235,14 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
235 235
 
236 236
 	if stdout != nil || stderr != nil {
237 237
 		if err := <-receiveStdout; err != nil {
238
-			log.Debugf("Error receiveStdout: %s", err)
238
+			logrus.Debugf("Error receiveStdout: %s", err)
239 239
 			return err
240 240
 		}
241 241
 	}
242 242
 
243 243
 	if !cli.isTerminalIn {
244 244
 		if err := <-sendStdin; err != nil {
245
-			log.Debugf("Error sendStdin: %s", err)
245
+			logrus.Debugf("Error sendStdin: %s", err)
246 246
 			return err
247 247
 		}
248 248
 	}
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"os"
6 6
 	"time"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/engine"
10 10
 	flag "github.com/docker/docker/pkg/mflag"
11 11
 	"github.com/docker/docker/pkg/units"
... ...
@@ -32,7 +32,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
32 32
 	}
33 33
 
34 34
 	if _, err := out.Write(body); err != nil {
35
-		log.Errorf("Error reading remote info: %s", err)
35
+		logrus.Errorf("Error reading remote info: %s", err)
36 36
 		return err
37 37
 	}
38 38
 	out.Close()
... ...
@@ -91,7 +91,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
91 91
 		if remoteInfo.Exists("SystemTime") {
92 92
 			t, err := remoteInfo.GetTime("SystemTime")
93 93
 			if err != nil {
94
-				log.Errorf("Error reading system time: %v", err)
94
+				logrus.Errorf("Error reading system time: %v", err)
95 95
 			} else {
96 96
 				fmt.Fprintf(cli.out, "System Time: %s\n", t.Format(time.UnixDate))
97 97
 			}
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 	"os"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/opts"
11 11
 	"github.com/docker/docker/pkg/promise"
12 12
 	"github.com/docker/docker/pkg/resolvconf"
... ...
@@ -132,9 +132,9 @@ func (cli *DockerCli) CmdRun(args ...string) error {
132 132
 	hijacked := make(chan io.Closer)
133 133
 	// Block the return until the chan gets closed
134 134
 	defer func() {
135
-		log.Debugf("End of CmdRun(), Waiting for hijack to finish.")
135
+		logrus.Debugf("End of CmdRun(), Waiting for hijack to finish.")
136 136
 		if _, ok := <-hijacked; ok {
137
-			log.Errorf("Hijack did not finish (chan still open)")
137
+			logrus.Errorf("Hijack did not finish (chan still open)")
138 138
 		}
139 139
 	}()
140 140
 	if config.AttachStdin || config.AttachStdout || config.AttachStderr {
... ...
@@ -176,7 +176,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
176 176
 		}
177 177
 	case err := <-errCh:
178 178
 		if err != nil {
179
-			log.Debugf("Error hijack: %s", err)
179
+			logrus.Debugf("Error hijack: %s", err)
180 180
 			return err
181 181
 		}
182 182
 	}
... ...
@@ -184,7 +184,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
184 184
 	defer func() {
185 185
 		if *flAutoRemove {
186 186
 			if _, _, err = readBody(cli.call("DELETE", "/containers/"+createResponse.ID+"?v=1", nil, nil)); err != nil {
187
-				log.Errorf("Error deleting container: %s", err)
187
+				logrus.Errorf("Error deleting container: %s", err)
188 188
 			}
189 189
 		}
190 190
 	}()
... ...
@@ -196,13 +196,13 @@ func (cli *DockerCli) CmdRun(args ...string) error {
196 196
 
197 197
 	if (config.AttachStdin || config.AttachStdout || config.AttachStderr) && config.Tty && cli.isTerminalOut {
198 198
 		if err := cli.monitorTtySize(createResponse.ID, false); err != nil {
199
-			log.Errorf("Error monitoring TTY size: %s", err)
199
+			logrus.Errorf("Error monitoring TTY size: %s", err)
200 200
 		}
201 201
 	}
202 202
 
203 203
 	if errCh != nil {
204 204
 		if err := <-errCh; err != nil {
205
-			log.Debugf("Error hijack: %s", err)
205
+			logrus.Debugf("Error hijack: %s", err)
206 206
 			return err
207 207
 		}
208 208
 	}
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 	"os"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/engine"
11 11
 	flag "github.com/docker/docker/pkg/mflag"
12 12
 	"github.com/docker/docker/pkg/promise"
... ...
@@ -30,10 +30,10 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
30 30
 				}
31 31
 			}
32 32
 			if sig == "" {
33
-				log.Errorf("Unsupported signal: %v. Discarding.", s)
33
+				logrus.Errorf("Unsupported signal: %v. Discarding.", s)
34 34
 			}
35 35
 			if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/kill?signal=%s", cid, sig), nil, nil)); err != nil {
36
-				log.Debugf("Error sending signal: %s", err)
36
+				logrus.Debugf("Error sending signal: %s", err)
37 37
 			}
38 38
 		}
39 39
 	}()
... ...
@@ -94,9 +94,9 @@ func (cli *DockerCli) CmdStart(args ...string) error {
94 94
 		hijacked := make(chan io.Closer)
95 95
 		// Block the return until the chan gets closed
96 96
 		defer func() {
97
-			log.Debugf("CmdStart() returned, defer waiting for hijack to finish.")
97
+			logrus.Debugf("CmdStart() returned, defer waiting for hijack to finish.")
98 98
 			if _, ok := <-hijacked; ok {
99
-				log.Errorf("Hijack did not finish (chan still open)")
99
+				logrus.Errorf("Hijack did not finish (chan still open)")
100 100
 			}
101 101
 			cli.in.Close()
102 102
 		}()
... ...
@@ -145,7 +145,7 @@ func (cli *DockerCli) CmdStart(args ...string) error {
145 145
 	if *openStdin || *attach {
146 146
 		if tty && cli.isTerminalOut {
147 147
 			if err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {
148
-				log.Errorf("Error monitoring TTY size: %s", err)
148
+				logrus.Errorf("Error monitoring TTY size: %s", err)
149 149
 			}
150 150
 		}
151 151
 		if attchErr := <-cErr; attchErr != nil {
... ...
@@ -15,7 +15,7 @@ import (
15 15
 	"strconv"
16 16
 	"strings"
17 17
 
18
-	log "github.com/Sirupsen/logrus"
18
+	"github.com/Sirupsen/logrus"
19 19
 	"github.com/docker/docker/api"
20 20
 	"github.com/docker/docker/autogen/dockerversion"
21 21
 	"github.com/docker/docker/engine"
... ...
@@ -195,7 +195,7 @@ func (cli *DockerCli) streamBody(body io.ReadCloser, contentType string, setRawT
195 195
 		} else {
196 196
 			_, err = stdcopy.StdCopy(stdout, stderr, body)
197 197
 		}
198
-		log.Debugf("[stream] End of stdout")
198
+		logrus.Debugf("[stream] End of stdout")
199 199
 		return err
200 200
 	}
201 201
 	return nil
... ...
@@ -218,7 +218,7 @@ func (cli *DockerCli) resizeTty(id string, isExec bool) {
218 218
 	}
219 219
 
220 220
 	if _, _, err := readBody(cli.call("POST", path+v.Encode(), nil, nil)); err != nil {
221
-		log.Debugf("Error resize: %s", err)
221
+		logrus.Debugf("Error resize: %s", err)
222 222
 	}
223 223
 }
224 224
 
... ...
@@ -295,7 +295,7 @@ func (cli *DockerCli) getTtySize() (int, int) {
295 295
 	}
296 296
 	ws, err := term.GetWinsize(cli.outFd)
297 297
 	if err != nil {
298
-		log.Debugf("Error getting size: %s", err)
298
+		logrus.Debugf("Error getting size: %s", err)
299 299
 		if ws == nil {
300 300
 			return 0, 0
301 301
 		}
... ...
@@ -4,7 +4,7 @@ import (
4 4
 	"fmt"
5 5
 	"runtime"
6 6
 
7
-	log "github.com/Sirupsen/logrus"
7
+	"github.com/Sirupsen/logrus"
8 8
 	"github.com/docker/docker/api"
9 9
 	"github.com/docker/docker/autogen/dockerversion"
10 10
 	"github.com/docker/docker/engine"
... ...
@@ -41,11 +41,11 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
41 41
 	out := engine.NewOutput()
42 42
 	remoteVersion, err := out.AddEnv()
43 43
 	if err != nil {
44
-		log.Errorf("Error reading remote version: %s", err)
44
+		logrus.Errorf("Error reading remote version: %s", err)
45 45
 		return err
46 46
 	}
47 47
 	if _, err := out.Write(body); err != nil {
48
-		log.Errorf("Error reading remote version: %s", err)
48
+		logrus.Errorf("Error reading remote version: %s", err)
49 49
 		return err
50 50
 	}
51 51
 	out.Close()
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"path/filepath"
8 8
 	"strings"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 	"github.com/docker/docker/engine"
12 12
 	"github.com/docker/docker/pkg/parsers"
13 13
 	"github.com/docker/docker/pkg/version"
... ...
@@ -105,7 +105,7 @@ func FormGroup(key string, start, last int) string {
105 105
 func MatchesContentType(contentType, expectedType string) bool {
106 106
 	mimetype, _, err := mime.ParseMediaType(contentType)
107 107
 	if err != nil {
108
-		log.Errorf("Error parsing media type: %s error: %v", contentType, err)
108
+		logrus.Errorf("Error parsing media type: %s error: %v", contentType, err)
109 109
 	}
110 110
 	return err == nil && mimetype == expectedType
111 111
 }
... ...
@@ -24,7 +24,7 @@ import (
24 24
 	"github.com/docker/libcontainer/user"
25 25
 	"github.com/gorilla/mux"
26 26
 
27
-	log "github.com/Sirupsen/logrus"
27
+	"github.com/Sirupsen/logrus"
28 28
 	"github.com/docker/docker/api"
29 29
 	"github.com/docker/docker/api/types"
30 30
 	"github.com/docker/docker/daemon/networkdriver/portallocator"
... ...
@@ -135,7 +135,7 @@ func httpError(w http.ResponseWriter, err error) {
135 135
 	}
136 136
 
137 137
 	if err != nil {
138
-		log.Errorf("HTTP Error: statusCode=%d %v", statusCode, err)
138
+		logrus.Errorf("HTTP Error: statusCode=%d %v", statusCode, err)
139 139
 		http.Error(w, err.Error(), statusCode)
140 140
 	}
141 141
 }
... ...
@@ -517,7 +517,7 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit
517 517
 	}
518 518
 
519 519
 	if err := config.Decode(r.Body); err != nil {
520
-		log.Errorf("%s", err)
520
+		logrus.Errorf("%s", err)
521 521
 	}
522 522
 
523 523
 	if r.FormValue("pause") == "" && version.GreaterThanOrEqualTo("1.13") {
... ...
@@ -987,7 +987,7 @@ func wsContainersAttach(eng *engine.Engine, version version.Version, w http.Resp
987 987
 		job.Stdout.Add(ws)
988 988
 		job.Stderr.Set(ws)
989 989
 		if err := job.Run(); err != nil {
990
-			log.Errorf("Error attaching websocket: %s", err)
990
+			logrus.Errorf("Error attaching websocket: %s", err)
991 991
 		}
992 992
 	})
993 993
 	h.ServeHTTP(w, r)
... ...
@@ -1101,7 +1101,7 @@ func postBuild(eng *engine.Engine, version version.Version, w http.ResponseWrite
1101 1101
 			select {
1102 1102
 			case <-finished:
1103 1103
 			case <-closeNotifier.CloseNotify():
1104
-				log.Infof("Client disconnected, cancelling job: %s", job.Name)
1104
+				logrus.Infof("Client disconnected, cancelling job: %s", job.Name)
1105 1105
 				job.Cancel()
1106 1106
 			}
1107 1107
 		}()
... ...
@@ -1146,7 +1146,7 @@ func postContainersCopy(eng *engine.Engine, version version.Version, w http.Resp
1146 1146
 	job.Stdout.Add(w)
1147 1147
 	w.Header().Set("Content-Type", "application/x-tar")
1148 1148
 	if err := job.Run(); err != nil {
1149
-		log.Errorf("%v", err)
1149
+		logrus.Errorf("%v", err)
1150 1150
 		if strings.Contains(strings.ToLower(err.Error()), "no such id") {
1151 1151
 			w.WriteHeader(http.StatusNotFound)
1152 1152
 		} else if strings.Contains(err.Error(), "no such file or directory") {
... ...
@@ -1262,7 +1262,7 @@ func optionsHandler(eng *engine.Engine, version version.Version, w http.Response
1262 1262
 	return nil
1263 1263
 }
1264 1264
 func writeCorsHeaders(w http.ResponseWriter, r *http.Request, corsHeaders string) {
1265
-	log.Debugf("CORS header is enabled and set to: %s", corsHeaders)
1265
+	logrus.Debugf("CORS header is enabled and set to: %s", corsHeaders)
1266 1266
 	w.Header().Add("Access-Control-Allow-Origin", corsHeaders)
1267 1267
 	w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
1268 1268
 	w.Header().Add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS")
... ...
@@ -1276,16 +1276,16 @@ func ping(eng *engine.Engine, version version.Version, w http.ResponseWriter, r
1276 1276
 func makeHttpHandler(eng *engine.Engine, logging bool, localMethod string, localRoute string, handlerFunc HttpApiFunc, corsHeaders string, dockerVersion version.Version) http.HandlerFunc {
1277 1277
 	return func(w http.ResponseWriter, r *http.Request) {
1278 1278
 		// log the request
1279
-		log.Debugf("Calling %s %s", localMethod, localRoute)
1279
+		logrus.Debugf("Calling %s %s", localMethod, localRoute)
1280 1280
 
1281 1281
 		if logging {
1282
-			log.Infof("%s %s", r.Method, r.RequestURI)
1282
+			logrus.Infof("%s %s", r.Method, r.RequestURI)
1283 1283
 		}
1284 1284
 
1285 1285
 		if strings.Contains(r.Header.Get("User-Agent"), "Docker-Client/") {
1286 1286
 			userAgent := strings.Split(r.Header.Get("User-Agent"), "/")
1287 1287
 			if len(userAgent) == 2 && !dockerVersion.Equal(version.Version(userAgent[1])) {
1288
-				log.Debugf("Warning: client and server don't have the same version (client: %s, server: %s)", userAgent[1], dockerVersion)
1288
+				logrus.Debugf("Warning: client and server don't have the same version (client: %s, server: %s)", userAgent[1], dockerVersion)
1289 1289
 			}
1290 1290
 		}
1291 1291
 		version := version.Version(mux.Vars(r)["version"])
... ...
@@ -1302,7 +1302,7 @@ func makeHttpHandler(eng *engine.Engine, logging bool, localMethod string, local
1302 1302
 		}
1303 1303
 
1304 1304
 		if err := handlerFunc(eng, version, w, r, mux.Vars(r)); err != nil {
1305
-			log.Errorf("Handler for %s %s returned error: %s", localMethod, localRoute, err)
1305
+			logrus.Errorf("Handler for %s %s returned error: %s", localMethod, localRoute, err)
1306 1306
 			httpError(w, err)
1307 1307
 		}
1308 1308
 	}
... ...
@@ -1406,7 +1406,7 @@ func createRouter(eng *engine.Engine, logging, enableCors bool, corsHeaders stri
1406 1406
 
1407 1407
 	for method, routes := range m {
1408 1408
 		for route, fct := range routes {
1409
-			log.Debugf("Registering %s, %s", method, route)
1409
+			logrus.Debugf("Registering %s, %s", method, route)
1410 1410
 			// NOTE: scope issue, make sure the variables are local and won't be changed
1411 1411
 			localRoute := route
1412 1412
 			localFct := fct
... ...
@@ -1454,7 +1454,7 @@ func lookupGidByName(nameOrGid string) (int, error) {
1454 1454
 	}
1455 1455
 	gid, err := strconv.Atoi(nameOrGid)
1456 1456
 	if err == nil {
1457
-		log.Warnf("Could not find GID %d", gid)
1457
+		logrus.Warnf("Could not find GID %d", gid)
1458 1458
 		return gid, nil
1459 1459
 	}
1460 1460
 	return -1, fmt.Errorf("Group %s not found", nameOrGid)
... ...
@@ -1504,7 +1504,7 @@ func changeGroup(addr string, nameOrGid string) error {
1504 1504
 		return err
1505 1505
 	}
1506 1506
 
1507
-	log.Debugf("%s group found. gid: %d", nameOrGid, gid)
1507
+	logrus.Debugf("%s group found. gid: %d", nameOrGid, gid)
1508 1508
 	return os.Chown(addr, 0, gid)
1509 1509
 }
1510 1510
 
... ...
@@ -1517,7 +1517,7 @@ func setSocketGroup(addr, group string) error {
1517 1517
 		if group != "docker" {
1518 1518
 			return err
1519 1519
 		}
1520
-		log.Debugf("Warning: could not chgrp %s to docker: %v", addr, err)
1520
+		logrus.Debugf("Warning: could not chgrp %s to docker: %v", addr, err)
1521 1521
 	}
1522 1522
 
1523 1523
 	return nil
... ...
@@ -1551,7 +1551,7 @@ func allocateDaemonPort(addr string) error {
1551 1551
 
1552 1552
 func setupTcpHttp(addr string, job *engine.Job) (*HttpServer, error) {
1553 1553
 	if !job.GetenvBool("TlsVerify") {
1554
-		log.Infof("/!\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\")
1554
+		logrus.Infof("/!\\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\\")
1555 1555
 	}
1556 1556
 
1557 1557
 	r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version"))
... ...
@@ -1601,7 +1601,7 @@ func ServeApi(job *engine.Job) error {
1601 1601
 			return fmt.Errorf("usage: %s PROTO://ADDR [PROTO://ADDR ...]", job.Name)
1602 1602
 		}
1603 1603
 		go func() {
1604
-			log.Infof("Listening for HTTP on %s (%s)", protoAddrParts[0], protoAddrParts[1])
1604
+			logrus.Infof("Listening for HTTP on %s (%s)", protoAddrParts[0], protoAddrParts[1])
1605 1605
 			srv, err := NewServer(protoAddrParts[0], protoAddrParts[1], job)
1606 1606
 			if err != nil {
1607 1607
 				chErrors <- err
... ...
@@ -1609,7 +1609,7 @@ func ServeApi(job *engine.Job) error {
1609 1609
 			}
1610 1610
 			job.Eng.OnShutdown(func() {
1611 1611
 				if err := srv.Close(); err != nil {
1612
-					log.Error(err)
1612
+					logrus.Error(err)
1613 1613
 				}
1614 1614
 			})
1615 1615
 			if err = srv.Serve(); err != nil && strings.Contains(err.Error(), "use of closed network connection") {
... ...
@@ -15,7 +15,7 @@ import (
15 15
 	"sort"
16 16
 	"strings"
17 17
 
18
-	log "github.com/Sirupsen/logrus"
18
+	"github.com/Sirupsen/logrus"
19 19
 	"github.com/docker/docker/nat"
20 20
 	flag "github.com/docker/docker/pkg/mflag"
21 21
 	"github.com/docker/docker/runconfig"
... ...
@@ -264,7 +264,7 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
264 264
 
265 265
 	defer func(cmd []string) { b.Config.Cmd = cmd }(cmd)
266 266
 
267
-	log.Debugf("[BUILDER] Command to be executed: %v", b.Config.Cmd)
267
+	logrus.Debugf("[BUILDER] Command to be executed: %v", b.Config.Cmd)
268 268
 
269 269
 	hit, err := b.probeCache()
270 270
 	if err != nil {
... ...
@@ -26,7 +26,7 @@ import (
26 26
 	"path/filepath"
27 27
 	"strings"
28 28
 
29
-	log "github.com/Sirupsen/logrus"
29
+	"github.com/Sirupsen/logrus"
30 30
 	"github.com/docker/docker/api"
31 31
 	"github.com/docker/docker/builder/command"
32 32
 	"github.com/docker/docker/builder/parser"
... ...
@@ -150,7 +150,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
150 150
 
151 151
 	defer func() {
152 152
 		if err := os.RemoveAll(b.contextPath); err != nil {
153
-			log.Debugf("[BUILDER] failed to remove temporary context: %s", err)
153
+			logrus.Debugf("[BUILDER] failed to remove temporary context: %s", err)
154 154
 		}
155 155
 	}()
156 156
 
... ...
@@ -166,7 +166,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
166 166
 	for i, n := range b.dockerfile.Children {
167 167
 		select {
168 168
 		case <-b.cancelled:
169
-			log.Debug("Builder: build cancelled!")
169
+			logrus.Debug("Builder: build cancelled!")
170 170
 			fmt.Fprintf(b.OutStream, "Build cancelled")
171 171
 			return "", fmt.Errorf("Build cancelled")
172 172
 		default:
... ...
@@ -19,7 +19,7 @@ import (
19 19
 	"syscall"
20 20
 	"time"
21 21
 
22
-	log "github.com/Sirupsen/logrus"
22
+	"github.com/Sirupsen/logrus"
23 23
 	"github.com/docker/docker/builder/parser"
24 24
 	"github.com/docker/docker/daemon"
25 25
 	imagepkg "github.com/docker/docker/image"
... ...
@@ -522,13 +522,13 @@ func (b *Builder) probeCache() (bool, error) {
522 522
 		return false, err
523 523
 	}
524 524
 	if cache == nil {
525
-		log.Debugf("[BUILDER] Cache miss")
525
+		logrus.Debugf("[BUILDER] Cache miss")
526 526
 		b.cacheBusted = true
527 527
 		return false, nil
528 528
 	}
529 529
 
530 530
 	fmt.Fprintf(b.OutStream, " ---> Using cache\n")
531
-	log.Debugf("[BUILDER] Use cached version")
531
+	logrus.Debugf("[BUILDER] Use cached version")
532 532
 	b.image = cache.ID
533 533
 	return true, nil
534 534
 }
... ...
@@ -587,7 +587,7 @@ func (b *Builder) run(c *daemon.Container) error {
587 587
 	go func() {
588 588
 		select {
589 589
 		case <-b.cancelled:
590
-			log.Debugln("Build cancelled, killing container:", c.ID)
590
+			logrus.Debugln("Build cancelled, killing container:", c.ID)
591 591
 			c.Kill()
592 592
 		case <-finished:
593 593
 		}
... ...
@@ -688,7 +688,7 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
688 688
 		if err := chrootarchive.UntarPath(origPath, tarDest); err == nil {
689 689
 			return nil
690 690
 		} else if err != io.EOF {
691
-			log.Debugf("Couldn't untar %s to %s: %s", origPath, tarDest, err)
691
+			logrus.Debugf("Couldn't untar %s to %s: %s", origPath, tarDest, err)
692 692
 		}
693 693
 	}
694 694
 
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"strconv"
10 10
 	"strings"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/daemon/graphdriver/devmapper"
14 14
 	"github.com/docker/docker/pkg/devicemapper"
15 15
 )
... ...
@@ -63,7 +63,7 @@ func main() {
63 63
 
64 64
 	if *flDebug {
65 65
 		os.Setenv("DEBUG", "1")
66
-		log.SetLevel(log.DebugLevel)
66
+		logrus.SetLevel(logrus.DebugLevel)
67 67
 	}
68 68
 
69 69
 	if flag.NArg() < 1 {
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"sync"
9 9
 	"time"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/engine"
13 13
 	"github.com/docker/docker/pkg/jsonlog"
14 14
 	"github.com/docker/docker/pkg/promise"
... ...
@@ -39,25 +39,25 @@ func (daemon *Daemon) ContainerAttach(job *engine.Job) error {
39 39
 		cLog, err := container.ReadLog("json")
40 40
 		if err != nil && os.IsNotExist(err) {
41 41
 			// Legacy logs
42
-			log.Debugf("Old logs format")
42
+			logrus.Debugf("Old logs format")
43 43
 			if stdout {
44 44
 				cLog, err := container.ReadLog("stdout")
45 45
 				if err != nil {
46
-					log.Errorf("Error reading logs (stdout): %s", err)
46
+					logrus.Errorf("Error reading logs (stdout): %s", err)
47 47
 				} else if _, err := io.Copy(job.Stdout, cLog); err != nil {
48
-					log.Errorf("Error streaming logs (stdout): %s", err)
48
+					logrus.Errorf("Error streaming logs (stdout): %s", err)
49 49
 				}
50 50
 			}
51 51
 			if stderr {
52 52
 				cLog, err := container.ReadLog("stderr")
53 53
 				if err != nil {
54
-					log.Errorf("Error reading logs (stderr): %s", err)
54
+					logrus.Errorf("Error reading logs (stderr): %s", err)
55 55
 				} else if _, err := io.Copy(job.Stderr, cLog); err != nil {
56
-					log.Errorf("Error streaming logs (stderr): %s", err)
56
+					logrus.Errorf("Error streaming logs (stderr): %s", err)
57 57
 				}
58 58
 			}
59 59
 		} else if err != nil {
60
-			log.Errorf("Error reading logs (json): %s", err)
60
+			logrus.Errorf("Error reading logs (json): %s", err)
61 61
 		} else {
62 62
 			dec := json.NewDecoder(cLog)
63 63
 			for {
... ...
@@ -66,7 +66,7 @@ func (daemon *Daemon) ContainerAttach(job *engine.Job) error {
66 66
 				if err := dec.Decode(l); err == io.EOF {
67 67
 					break
68 68
 				} else if err != nil {
69
-					log.Errorf("Error streaming logs: %s", err)
69
+					logrus.Errorf("Error streaming logs: %s", err)
70 70
 					break
71 71
 				}
72 72
 				if l.Stream == "stdout" && stdout {
... ...
@@ -90,7 +90,7 @@ func (daemon *Daemon) ContainerAttach(job *engine.Job) error {
90 90
 			r, w := io.Pipe()
91 91
 			go func() {
92 92
 				defer w.Close()
93
-				defer log.Debugf("Closing buffered stdin pipe")
93
+				defer logrus.Debugf("Closing buffered stdin pipe")
94 94
 				io.Copy(w, job.Stdin)
95 95
 			}()
96 96
 			cStdin = r
... ...
@@ -140,7 +140,7 @@ func (daemon *Daemon) Attach(streamConfig *StreamConfig, openStdin, stdinOnce, t
140 140
 		if stdin == nil || !openStdin {
141 141
 			return
142 142
 		}
143
-		log.Debugf("attach: stdin: begin")
143
+		logrus.Debugf("attach: stdin: begin")
144 144
 		defer func() {
145 145
 			if stdinOnce && !tty {
146 146
 				cStdin.Close()
... ...
@@ -154,7 +154,7 @@ func (daemon *Daemon) Attach(streamConfig *StreamConfig, openStdin, stdinOnce, t
154 154
 				}
155 155
 			}
156 156
 			wg.Done()
157
-			log.Debugf("attach: stdin: end")
157
+			logrus.Debugf("attach: stdin: end")
158 158
 		}()
159 159
 
160 160
 		var err error
... ...
@@ -168,7 +168,7 @@ func (daemon *Daemon) Attach(streamConfig *StreamConfig, openStdin, stdinOnce, t
168 168
 			err = nil
169 169
 		}
170 170
 		if err != nil {
171
-			log.Errorf("attach: stdin: %s", err)
171
+			logrus.Errorf("attach: stdin: %s", err)
172 172
 			errors <- err
173 173
 			return
174 174
 		}
... ...
@@ -185,16 +185,16 @@ func (daemon *Daemon) Attach(streamConfig *StreamConfig, openStdin, stdinOnce, t
185 185
 			}
186 186
 			streamPipe.Close()
187 187
 			wg.Done()
188
-			log.Debugf("attach: %s: end", name)
188
+			logrus.Debugf("attach: %s: end", name)
189 189
 		}()
190 190
 
191
-		log.Debugf("attach: %s: begin", name)
191
+		logrus.Debugf("attach: %s: begin", name)
192 192
 		_, err := io.Copy(stream, streamPipe)
193 193
 		if err == io.ErrClosedPipe {
194 194
 			err = nil
195 195
 		}
196 196
 		if err != nil {
197
-			log.Errorf("attach: %s: %v", name, err)
197
+			logrus.Errorf("attach: %s: %v", name, err)
198 198
 			errors <- err
199 199
 		}
200 200
 	}
... ...
@@ -19,7 +19,7 @@ import (
19 19
 	"github.com/docker/libcontainer/devices"
20 20
 	"github.com/docker/libcontainer/label"
21 21
 
22
-	log "github.com/Sirupsen/logrus"
22
+	"github.com/Sirupsen/logrus"
23 23
 	"github.com/docker/docker/daemon/execdriver"
24 24
 	"github.com/docker/docker/daemon/logger"
25 25
 	"github.com/docker/docker/daemon/logger/jsonfilelog"
... ...
@@ -201,7 +201,7 @@ func (container *Container) WriteHostConfig() error {
201 201
 func (container *Container) LogEvent(action string) {
202 202
 	d := container.daemon
203 203
 	if err := d.eng.Job("log", action, container.ID, d.Repositories().ImageName(container.ImageID)).Run(); err != nil {
204
-		log.Errorf("Error logging event %s for %s: %s", action, container.ID, err)
204
+		logrus.Errorf("Error logging event %s for %s: %s", action, container.ID, err)
205 205
 	}
206 206
 }
207 207
 
... ...
@@ -659,7 +659,7 @@ func (container *Container) cleanup() {
659 659
 	}
660 660
 
661 661
 	if err := container.Unmount(); err != nil {
662
-		log.Errorf("%v: Failed to umount filesystem: %v", container.ID, err)
662
+		logrus.Errorf("%v: Failed to umount filesystem: %v", container.ID, err)
663 663
 	}
664 664
 
665 665
 	for _, eConfig := range container.execCommands.s {
... ...
@@ -668,7 +668,7 @@ func (container *Container) cleanup() {
668 668
 }
669 669
 
670 670
 func (container *Container) KillSig(sig int) error {
671
-	log.Debugf("Sending %d to %s", sig, container.ID)
671
+	logrus.Debugf("Sending %d to %s", sig, container.ID)
672 672
 	container.Lock()
673 673
 	defer container.Unlock()
674 674
 
... ...
@@ -699,7 +699,7 @@ func (container *Container) KillSig(sig int) error {
699 699
 func (container *Container) killPossiblyDeadProcess(sig int) error {
700 700
 	err := container.KillSig(sig)
701 701
 	if err == syscall.ESRCH {
702
-		log.Debugf("Cannot kill process (pid=%d) with signal %d: no such process.", container.GetPid(), sig)
702
+		logrus.Debugf("Cannot kill process (pid=%d) with signal %d: no such process.", container.GetPid(), sig)
703 703
 		return nil
704 704
 	}
705 705
 	return err
... ...
@@ -739,12 +739,12 @@ func (container *Container) Kill() error {
739 739
 	if _, err := container.WaitStop(10 * time.Second); err != nil {
740 740
 		// Ensure that we don't kill ourselves
741 741
 		if pid := container.GetPid(); pid != 0 {
742
-			log.Infof("Container %s failed to exit within 10 seconds of kill - trying direct SIGKILL", stringid.TruncateID(container.ID))
742
+			logrus.Infof("Container %s failed to exit within 10 seconds of kill - trying direct SIGKILL", stringid.TruncateID(container.ID))
743 743
 			if err := syscall.Kill(pid, 9); err != nil {
744 744
 				if err != syscall.ESRCH {
745 745
 					return err
746 746
 				}
747
-				log.Debugf("Cannot kill process (pid=%d) with signal 9: no such process.", pid)
747
+				logrus.Debugf("Cannot kill process (pid=%d) with signal 9: no such process.", pid)
748 748
 			}
749 749
 		}
750 750
 	}
... ...
@@ -760,7 +760,7 @@ func (container *Container) Stop(seconds int) error {
760 760
 
761 761
 	// 1. Send a SIGTERM
762 762
 	if err := container.killPossiblyDeadProcess(15); err != nil {
763
-		log.Infof("Failed to send SIGTERM to the process, force killing")
763
+		logrus.Infof("Failed to send SIGTERM to the process, force killing")
764 764
 		if err := container.killPossiblyDeadProcess(9); err != nil {
765 765
 			return err
766 766
 		}
... ...
@@ -768,7 +768,7 @@ func (container *Container) Stop(seconds int) error {
768 768
 
769 769
 	// 2. Wait for the process to exit on its own
770 770
 	if _, err := container.WaitStop(time.Duration(seconds) * time.Second); err != nil {
771
-		log.Infof("Container %v failed to exit within %d seconds of SIGTERM - using the force", container.ID, seconds)
771
+		logrus.Infof("Container %v failed to exit within %d seconds of SIGTERM - using the force", container.ID, seconds)
772 772
 		// 3. If it doesn't, then send SIGKILL
773 773
 		if err := container.Kill(); err != nil {
774 774
 			container.WaitStop(-1 * time.Second)
... ...
@@ -904,7 +904,7 @@ func (container *Container) GetSize() (int64, int64) {
904 904
 	)
905 905
 
906 906
 	if err := container.Mount(); err != nil {
907
-		log.Errorf("Failed to compute size of container rootfs %s: %s", container.ID, err)
907
+		logrus.Errorf("Failed to compute size of container rootfs %s: %s", container.ID, err)
908 908
 		return sizeRw, sizeRootfs
909 909
 	}
910 910
 	defer container.Unmount()
... ...
@@ -912,7 +912,7 @@ func (container *Container) GetSize() (int64, int64) {
912 912
 	initID := fmt.Sprintf("%s-init", container.ID)
913 913
 	sizeRw, err = driver.DiffSize(container.ID, initID)
914 914
 	if err != nil {
915
-		log.Errorf("Driver %s couldn't return diff size of container %s: %s", driver, container.ID, err)
915
+		logrus.Errorf("Driver %s couldn't return diff size of container %s: %s", driver, container.ID, err)
916 916
 		// FIXME: GetSize should return an error. Not changing it now in case
917 917
 		// there is a side-effect.
918 918
 		sizeRw = -1
... ...
@@ -1007,7 +1007,7 @@ func (container *Container) DisableLink(name string) {
1007 1007
 		if link, exists := container.activeLinks[name]; exists {
1008 1008
 			link.Disable()
1009 1009
 		} else {
1010
-			log.Debugf("Could not find active link for %s", name)
1010
+			logrus.Debugf("Could not find active link for %s", name)
1011 1011
 		}
1012 1012
 	}
1013 1013
 }
... ...
@@ -1017,7 +1017,7 @@ func (container *Container) setupContainerDns() error {
1017 1017
 		// check if this is an existing container that needs DNS update:
1018 1018
 		if container.UpdateDns {
1019 1019
 			// read the host's resolv.conf, get the hash and call updateResolvConf
1020
-			log.Debugf("Check container (%s) for update to resolv.conf - UpdateDns flag was set", container.ID)
1020
+			logrus.Debugf("Check container (%s) for update to resolv.conf - UpdateDns flag was set", container.ID)
1021 1021
 			latestResolvConf, latestHash := resolvconf.GetLastModified()
1022 1022
 
1023 1023
 			// clean container resolv.conf re: localhost nameservers and IPv6 NS (if IPv6 disabled)
... ...
@@ -1133,7 +1133,7 @@ func (container *Container) updateResolvConf(updatedResolvConf []byte, newResolv
1133 1133
 	//if the user has not modified the resolv.conf of the container since we wrote it last
1134 1134
 	//we will replace it with the updated resolv.conf from the host
1135 1135
 	if string(hashBytes) == curHash {
1136
-		log.Debugf("replacing %q with updated host resolv.conf", container.ResolvConfPath)
1136
+		logrus.Debugf("replacing %q with updated host resolv.conf", container.ResolvConfPath)
1137 1137
 
1138 1138
 		// for atomic updates to these files, use temporary files with os.Rename:
1139 1139
 		dir := path.Dir(container.ResolvConfPath)
... ...
@@ -1172,13 +1172,13 @@ func (container *Container) updateParentsHosts() error {
1172 1172
 
1173 1173
 		c, err := container.daemon.Get(ref.ParentID)
1174 1174
 		if err != nil {
1175
-			log.Error(err)
1175
+			logrus.Error(err)
1176 1176
 		}
1177 1177
 
1178 1178
 		if c != nil && !container.daemon.config.DisableNetwork && container.hostConfig.NetworkMode.IsPrivate() {
1179
-			log.Debugf("Update /etc/hosts of %s for alias %s with ip %s", c.ID, ref.Name, container.NetworkSettings.IPAddress)
1179
+			logrus.Debugf("Update /etc/hosts of %s for alias %s with ip %s", c.ID, ref.Name, container.NetworkSettings.IPAddress)
1180 1180
 			if err := etchosts.Update(c.HostsPath, container.NetworkSettings.IPAddress, ref.Name); err != nil {
1181
-				log.Errorf("Failed to update /etc/hosts in parent container %s for alias %s: %v", c.ID, ref.Name, err)
1181
+				logrus.Errorf("Failed to update /etc/hosts in parent container %s for alias %s: %v", c.ID, ref.Name, err)
1182 1182
 			}
1183 1183
 		}
1184 1184
 	}
... ...
@@ -1244,15 +1244,15 @@ func (container *Container) initializeNetworking() error {
1244 1244
 // Make sure the config is compatible with the current kernel
1245 1245
 func (container *Container) verifyDaemonSettings() {
1246 1246
 	if container.Config.Memory > 0 && !container.daemon.sysInfo.MemoryLimit {
1247
-		log.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
1247
+		logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
1248 1248
 		container.Config.Memory = 0
1249 1249
 	}
1250 1250
 	if container.Config.Memory > 0 && !container.daemon.sysInfo.SwapLimit {
1251
-		log.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.")
1251
+		logrus.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.")
1252 1252
 		container.Config.MemorySwap = -1
1253 1253
 	}
1254 1254
 	if container.daemon.sysInfo.IPv4ForwardingDisabled {
1255
-		log.Warnf("IPv4 forwarding is disabled. Networking will not work")
1255
+		logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
1256 1256
 	}
1257 1257
 }
1258 1258
 
... ...
@@ -16,7 +16,7 @@ import (
16 16
 
17 17
 	"github.com/docker/libcontainer/label"
18 18
 
19
-	log "github.com/Sirupsen/logrus"
19
+	"github.com/Sirupsen/logrus"
20 20
 	"github.com/docker/docker/api"
21 21
 	"github.com/docker/docker/autogen/dockerversion"
22 22
 	"github.com/docker/docker/daemon/execdriver"
... ...
@@ -261,7 +261,7 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
261 261
 	//        if so, then we need to restart monitor and init a new lock
262 262
 	// If the container is supposed to be running, make sure of it
263 263
 	if container.IsRunning() {
264
-		log.Debugf("killing old running container %s", container.ID)
264
+		logrus.Debugf("killing old running container %s", container.ID)
265 265
 
266 266
 		existingPid := container.Pid
267 267
 		container.SetStopped(&execdriver.ExitStatus{ExitCode: 0})
... ...
@@ -278,23 +278,23 @@ func (daemon *Daemon) register(container *Container, updateSuffixarray bool) err
278 278
 			var err error
279 279
 			cmd.ProcessConfig.Process, err = os.FindProcess(existingPid)
280 280
 			if err != nil {
281
-				log.Debugf("cannot find existing process for %d", existingPid)
281
+				logrus.Debugf("cannot find existing process for %d", existingPid)
282 282
 			}
283 283
 			daemon.execDriver.Terminate(cmd)
284 284
 		}
285 285
 
286 286
 		if err := container.Unmount(); err != nil {
287
-			log.Debugf("unmount error %s", err)
287
+			logrus.Debugf("unmount error %s", err)
288 288
 		}
289 289
 		if err := container.ToDisk(); err != nil {
290
-			log.Debugf("saving stopped state to disk %s", err)
290
+			logrus.Debugf("saving stopped state to disk %s", err)
291 291
 		}
292 292
 
293 293
 		info := daemon.execDriver.Info(container.ID)
294 294
 		if !info.IsRunning() {
295
-			log.Debugf("Container %s was supposed to be running but is not.", container.ID)
295
+			logrus.Debugf("Container %s was supposed to be running but is not.", container.ID)
296 296
 
297
-			log.Debug("Marking as stopped")
297
+			logrus.Debug("Marking as stopped")
298 298
 
299 299
 			container.SetStopped(&execdriver.ExitStatus{ExitCode: -127})
300 300
 			if err := container.ToDisk(); err != nil {
... ...
@@ -314,7 +314,7 @@ func (daemon *Daemon) ensureName(container *Container) error {
314 314
 		container.Name = name
315 315
 
316 316
 		if err := container.ToDisk(); err != nil {
317
-			log.Debugf("Error saving container name %s", err)
317
+			logrus.Debugf("Error saving container name %s", err)
318 318
 		}
319 319
 	}
320 320
 	return nil
... ...
@@ -337,7 +337,7 @@ func (daemon *Daemon) restore() error {
337 337
 	)
338 338
 
339 339
 	if !debug {
340
-		log.Info("Loading containers: start.")
340
+		logrus.Info("Loading containers: start.")
341 341
 	}
342 342
 	dir, err := ioutil.ReadDir(daemon.repository)
343 343
 	if err != nil {
... ...
@@ -347,21 +347,21 @@ func (daemon *Daemon) restore() error {
347 347
 	for _, v := range dir {
348 348
 		id := v.Name()
349 349
 		container, err := daemon.load(id)
350
-		if !debug && log.GetLevel() == log.InfoLevel {
350
+		if !debug && logrus.GetLevel() == logrus.InfoLevel {
351 351
 			fmt.Print(".")
352 352
 		}
353 353
 		if err != nil {
354
-			log.Errorf("Failed to load container %v: %v", id, err)
354
+			logrus.Errorf("Failed to load container %v: %v", id, err)
355 355
 			continue
356 356
 		}
357 357
 
358 358
 		// Ignore the container if it does not support the current driver being used by the graph
359 359
 		if (container.Driver == "" && currentDriver == "aufs") || container.Driver == currentDriver {
360
-			log.Debugf("Loaded container %v", container.ID)
360
+			logrus.Debugf("Loaded container %v", container.ID)
361 361
 
362 362
 			containers[container.ID] = container
363 363
 		} else {
364
-			log.Debugf("Cannot load container %s because it was created with another graph driver.", container.ID)
364
+			logrus.Debugf("Cannot load container %s because it was created with another graph driver.", container.ID)
365 365
 		}
366 366
 	}
367 367
 
... ...
@@ -369,7 +369,7 @@ func (daemon *Daemon) restore() error {
369 369
 
370 370
 	if entities := daemon.containerGraph.List("/", -1); entities != nil {
371 371
 		for _, p := range entities.Paths() {
372
-			if !debug && log.GetLevel() == log.InfoLevel {
372
+			if !debug && logrus.GetLevel() == logrus.InfoLevel {
373 373
 				fmt.Print(".")
374 374
 			}
375 375
 
... ...
@@ -377,7 +377,7 @@ func (daemon *Daemon) restore() error {
377 377
 
378 378
 			if container, ok := containers[e.ID()]; ok {
379 379
 				if err := daemon.register(container, false); err != nil {
380
-					log.Debugf("Failed to register container %s: %s", container.ID, err)
380
+					logrus.Debugf("Failed to register container %s: %s", container.ID, err)
381 381
 				}
382 382
 
383 383
 				registeredContainers = append(registeredContainers, container)
... ...
@@ -393,11 +393,11 @@ func (daemon *Daemon) restore() error {
393 393
 		// Try to set the default name for a container if it exists prior to links
394 394
 		container.Name, err = daemon.generateNewName(container.ID)
395 395
 		if err != nil {
396
-			log.Debugf("Setting default id - %s", err)
396
+			logrus.Debugf("Setting default id - %s", err)
397 397
 		}
398 398
 
399 399
 		if err := daemon.register(container, false); err != nil {
400
-			log.Debugf("Failed to register container %s: %s", container.ID, err)
400
+			logrus.Debugf("Failed to register container %s: %s", container.ID, err)
401 401
 		}
402 402
 
403 403
 		registeredContainers = append(registeredContainers, container)
... ...
@@ -406,25 +406,25 @@ func (daemon *Daemon) restore() error {
406 406
 	// check the restart policy on the containers and restart any container with
407 407
 	// the restart policy of "always"
408 408
 	if daemon.config.AutoRestart {
409
-		log.Debug("Restarting containers...")
409
+		logrus.Debug("Restarting containers...")
410 410
 
411 411
 		for _, container := range registeredContainers {
412 412
 			if container.hostConfig.RestartPolicy.Name == "always" ||
413 413
 				(container.hostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0) {
414
-				log.Debugf("Starting container %s", container.ID)
414
+				logrus.Debugf("Starting container %s", container.ID)
415 415
 
416 416
 				if err := container.Start(); err != nil {
417
-					log.Debugf("Failed to start container %s: %s", container.ID, err)
417
+					logrus.Debugf("Failed to start container %s: %s", container.ID, err)
418 418
 				}
419 419
 			}
420 420
 		}
421 421
 	}
422 422
 
423 423
 	if !debug {
424
-		if log.GetLevel() == log.InfoLevel {
424
+		if logrus.GetLevel() == logrus.InfoLevel {
425 425
 			fmt.Println()
426 426
 		}
427
-		log.Info("Loading containers: done.")
427
+		logrus.Info("Loading containers: done.")
428 428
 	}
429 429
 
430 430
 	return nil
... ...
@@ -451,7 +451,7 @@ func (daemon *Daemon) setupResolvconfWatcher() error {
451 451
 					// without an actual change to the file
452 452
 					updatedResolvConf, newResolvConfHash, err := resolvconf.GetIfChanged()
453 453
 					if err != nil {
454
-						log.Debugf("Error retrieving updated host resolv.conf: %v", err)
454
+						logrus.Debugf("Error retrieving updated host resolv.conf: %v", err)
455 455
 					} else if updatedResolvConf != nil {
456 456
 						// because the new host resolv.conf might have localhost nameservers..
457 457
 						updatedResolvConf, modified := resolvconf.FilterResolvDns(updatedResolvConf, daemon.config.EnableIPv6)
... ...
@@ -459,22 +459,22 @@ func (daemon *Daemon) setupResolvconfWatcher() error {
459 459
 							// changes have occurred during localhost cleanup: generate an updated hash
460 460
 							newHash, err := utils.HashData(bytes.NewReader(updatedResolvConf))
461 461
 							if err != nil {
462
-								log.Debugf("Error generating hash of new resolv.conf: %v", err)
462
+								logrus.Debugf("Error generating hash of new resolv.conf: %v", err)
463 463
 							} else {
464 464
 								newResolvConfHash = newHash
465 465
 							}
466 466
 						}
467
-						log.Debug("host network resolv.conf changed--walking container list for updates")
467
+						logrus.Debug("host network resolv.conf changed--walking container list for updates")
468 468
 						contList := daemon.containers.List()
469 469
 						for _, container := range contList {
470 470
 							if err := container.updateResolvConf(updatedResolvConf, newResolvConfHash); err != nil {
471
-								log.Debugf("Error on resolv.conf update check for container ID: %s: %v", container.ID, err)
471
+								logrus.Debugf("Error on resolv.conf update check for container ID: %s: %v", container.ID, err)
472 472
 							}
473 473
 						}
474 474
 					}
475 475
 				}
476 476
 			case err := <-watcher.Errors:
477
-				log.Debugf("host resolv.conf notify error: %v", err)
477
+				logrus.Debugf("host resolv.conf notify error: %v", err)
478 478
 			}
479 479
 		}
480 480
 	}()
... ...
@@ -830,7 +830,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
830 830
 	// register portallocator release on shutdown
831 831
 	eng.OnShutdown(func() {
832 832
 		if err := portallocator.ReleaseAll(); err != nil {
833
-			log.Errorf("portallocator.ReleaseAll(): %s", err)
833
+			logrus.Errorf("portallocator.ReleaseAll(): %s", err)
834 834
 		}
835 835
 	})
836 836
 	// Claim the pidfile first, to avoid any and all unexpected race conditions.
... ...
@@ -892,11 +892,11 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
892 892
 	if err != nil {
893 893
 		return nil, fmt.Errorf("error intializing graphdriver: %v", err)
894 894
 	}
895
-	log.Debugf("Using graph driver %s", driver)
895
+	logrus.Debugf("Using graph driver %s", driver)
896 896
 	// register cleanup for graph driver
897 897
 	eng.OnShutdown(func() {
898 898
 		if err := driver.Cleanup(); err != nil {
899
-			log.Errorf("Error during graph storage driver.Cleanup(): %v", err)
899
+			logrus.Errorf("Error during graph storage driver.Cleanup(): %v", err)
900 900
 		}
901 901
 	})
902 902
 
... ...
@@ -906,9 +906,9 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
906 906
 			if driver.String() == "btrfs" {
907 907
 				return nil, fmt.Errorf("SELinux is not supported with the BTRFS graph driver")
908 908
 			}
909
-			log.Debug("SELinux enabled successfully")
909
+			logrus.Debug("SELinux enabled successfully")
910 910
 		} else {
911
-			log.Warn("Docker could not enable SELinux on the host system")
911
+			logrus.Warn("Docker could not enable SELinux on the host system")
912 912
 		}
913 913
 	} else {
914 914
 		selinuxSetDisabled()
... ...
@@ -925,7 +925,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
925 925
 		return nil, err
926 926
 	}
927 927
 
928
-	log.Debug("Creating images graph")
928
+	logrus.Debug("Creating images graph")
929 929
 	g, err := graph.NewGraph(path.Join(config.Root, "graph"), driver)
930 930
 	if err != nil {
931 931
 		return nil, err
... ...
@@ -946,7 +946,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
946 946
 		return nil, err
947 947
 	}
948 948
 
949
-	log.Debug("Creating repository list")
949
+	logrus.Debug("Creating repository list")
950 950
 	repositories, err := graph.NewTagStore(path.Join(config.Root, "repositories-"+driver.String()), g, trustKey)
951 951
 	if err != nil {
952 952
 		return nil, fmt.Errorf("Couldn't create Tag store: %s", err)
... ...
@@ -988,7 +988,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
988 988
 	// register graph close on shutdown
989 989
 	eng.OnShutdown(func() {
990 990
 		if err := graph.Close(); err != nil {
991
-			log.Errorf("Error during container graph.Close(): %v", err)
991
+			logrus.Errorf("Error during container graph.Close(): %v", err)
992 992
 		}
993 993
 	})
994 994
 
... ...
@@ -1042,7 +1042,7 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
1042 1042
 
1043 1043
 	eng.OnShutdown(func() {
1044 1044
 		if err := daemon.shutdown(); err != nil {
1045
-			log.Errorf("Error during daemon.shutdown(): %v", err)
1045
+			logrus.Errorf("Error during daemon.shutdown(): %v", err)
1046 1046
 		}
1047 1047
 	})
1048 1048
 
... ...
@@ -1060,20 +1060,20 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
1060 1060
 
1061 1061
 func (daemon *Daemon) shutdown() error {
1062 1062
 	group := sync.WaitGroup{}
1063
-	log.Debug("starting clean shutdown of all containers...")
1063
+	logrus.Debug("starting clean shutdown of all containers...")
1064 1064
 	for _, container := range daemon.List() {
1065 1065
 		c := container
1066 1066
 		if c.IsRunning() {
1067
-			log.Debugf("stopping %s", c.ID)
1067
+			logrus.Debugf("stopping %s", c.ID)
1068 1068
 			group.Add(1)
1069 1069
 
1070 1070
 			go func() {
1071 1071
 				defer group.Done()
1072 1072
 				if err := c.KillSig(15); err != nil {
1073
-					log.Debugf("kill 15 error for %s - %s", c.ID, err)
1073
+					logrus.Debugf("kill 15 error for %s - %s", c.ID, err)
1074 1074
 				}
1075 1075
 				c.WaitStop(-1 * time.Second)
1076
-				log.Debugf("container stopped %s", c.ID)
1076
+				logrus.Debugf("container stopped %s", c.ID)
1077 1077
 			}()
1078 1078
 		}
1079 1079
 	}
... ...
@@ -1255,11 +1255,11 @@ func checkKernel() error {
1255 1255
 	// the circumstances of pre-3.8 crashes are clearer.
1256 1256
 	// For details see http://github.com/docker/docker/issues/407
1257 1257
 	if k, err := kernel.GetKernelVersion(); err != nil {
1258
-		log.Warnf("%s", err)
1258
+		logrus.Warnf("%s", err)
1259 1259
 	} else {
1260 1260
 		if kernel.CompareKernelVersion(k, &kernel.KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0}) < 0 {
1261 1261
 			if os.Getenv("DOCKER_NOWARN_KERNEL_VERSION") == "" {
1262
-				log.Warnf("You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
1262
+				logrus.Warnf("You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
1263 1263
 			}
1264 1264
 		}
1265 1265
 	}
... ...
@@ -3,7 +3,7 @@
3 3
 package daemon
4 4
 
5 5
 import (
6
-	log "github.com/Sirupsen/logrus"
6
+	"github.com/Sirupsen/logrus"
7 7
 	"github.com/docker/docker/daemon/graphdriver"
8 8
 	"github.com/docker/docker/daemon/graphdriver/aufs"
9 9
 	"github.com/docker/docker/graph"
... ...
@@ -13,7 +13,7 @@ import (
13 13
 // If aufs driver is not built, this func is a noop.
14 14
 func migrateIfAufs(driver graphdriver.Driver, root string) error {
15 15
 	if ad, ok := driver.(*aufs.Driver); ok {
16
-		log.Debugf("Migrating existing containers")
16
+		logrus.Debugf("Migrating existing containers")
17 17
 		if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
18 18
 			return err
19 19
 		}
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"os"
6 6
 	"path"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/engine"
10 10
 )
11 11
 
... ...
@@ -77,7 +77,7 @@ func (daemon *Daemon) ContainerRm(job *engine.Job) error {
77 77
 func (daemon *Daemon) DeleteVolumes(volumeIDs map[string]struct{}) {
78 78
 	for id := range volumeIDs {
79 79
 		if err := daemon.volumes.Delete(id); err != nil {
80
-			log.Infof("%s", err)
80
+			logrus.Infof("%s", err)
81 81
 			continue
82 82
 		}
83 83
 	}
... ...
@@ -103,7 +103,7 @@ func (daemon *Daemon) Rm(container *Container) error {
103 103
 	daemon.containers.Delete(container.ID)
104 104
 	container.derefVolumes()
105 105
 	if _, err := daemon.containerGraph.Purge(container.ID); err != nil {
106
-		log.Debugf("Unable to remove container from link graph: %s", err)
106
+		logrus.Debugf("Unable to remove container from link graph: %s", err)
107 107
 	}
108 108
 
109 109
 	if err := daemon.driver.Remove(container.ID); err != nil {
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"strings"
8 8
 	"sync"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 	"github.com/docker/docker/daemon/execdriver"
12 12
 	"github.com/docker/docker/daemon/execdriver/lxc"
13 13
 	"github.com/docker/docker/engine"
... ...
@@ -188,7 +188,7 @@ func (d *Daemon) ContainerExecStart(job *engine.Job) error {
188 188
 		return err
189 189
 	}
190 190
 
191
-	log.Debugf("starting exec command %s in container %s", execConfig.ID, execConfig.Container.ID)
191
+	logrus.Debugf("starting exec command %s in container %s", execConfig.ID, execConfig.Container.ID)
192 192
 	container := execConfig.Container
193 193
 
194 194
 	container.LogEvent("exec_start: " + execConfig.ProcessConfig.Entrypoint + " " + strings.Join(execConfig.ProcessConfig.Arguments, " "))
... ...
@@ -197,7 +197,7 @@ func (d *Daemon) ContainerExecStart(job *engine.Job) error {
197 197
 		r, w := io.Pipe()
198 198
 		go func() {
199 199
 			defer w.Close()
200
-			defer log.Debugf("Closing buffered stdin pipe")
200
+			defer logrus.Debugf("Closing buffered stdin pipe")
201 201
 			io.Copy(w, job.Stdin)
202 202
 		}()
203 203
 		cStdin = r
... ...
@@ -305,24 +305,24 @@ func (container *Container) monitorExec(execConfig *execConfig, callback execdri
305 305
 	pipes := execdriver.NewPipes(execConfig.StreamConfig.stdin, execConfig.StreamConfig.stdout, execConfig.StreamConfig.stderr, execConfig.OpenStdin)
306 306
 	exitCode, err = container.daemon.Exec(container, execConfig, pipes, callback)
307 307
 	if err != nil {
308
-		log.Errorf("Error running command in existing container %s: %s", container.ID, err)
308
+		logrus.Errorf("Error running command in existing container %s: %s", container.ID, err)
309 309
 	}
310 310
 
311
-	log.Debugf("Exec task in container %s exited with code %d", container.ID, exitCode)
311
+	logrus.Debugf("Exec task in container %s exited with code %d", container.ID, exitCode)
312 312
 	if execConfig.OpenStdin {
313 313
 		if err := execConfig.StreamConfig.stdin.Close(); err != nil {
314
-			log.Errorf("Error closing stdin while running in %s: %s", container.ID, err)
314
+			logrus.Errorf("Error closing stdin while running in %s: %s", container.ID, err)
315 315
 		}
316 316
 	}
317 317
 	if err := execConfig.StreamConfig.stdout.Clean(); err != nil {
318
-		log.Errorf("Error closing stdout while running in %s: %s", container.ID, err)
318
+		logrus.Errorf("Error closing stdout while running in %s: %s", container.ID, err)
319 319
 	}
320 320
 	if err := execConfig.StreamConfig.stderr.Clean(); err != nil {
321
-		log.Errorf("Error closing stderr while running in %s: %s", container.ID, err)
321
+		logrus.Errorf("Error closing stderr while running in %s: %s", container.ID, err)
322 322
 	}
323 323
 	if execConfig.ProcessConfig.Terminal != nil {
324 324
 		if err := execConfig.ProcessConfig.Terminal.Close(); err != nil {
325
-			log.Errorf("Error closing terminal while running in container %s: %s", container.ID, err)
325
+			logrus.Errorf("Error closing terminal while running in container %s: %s", container.ID, err)
326 326
 		}
327 327
 	}
328 328
 
... ...
@@ -16,7 +16,7 @@ import (
16 16
 	"syscall"
17 17
 	"time"
18 18
 
19
-	log "github.com/Sirupsen/logrus"
19
+	"github.com/Sirupsen/logrus"
20 20
 	"github.com/docker/docker/daemon/execdriver"
21 21
 	sysinfo "github.com/docker/docker/pkg/system"
22 22
 	"github.com/docker/docker/pkg/term"
... ...
@@ -193,7 +193,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
193 193
 			"unshare", "-m", "--", "/bin/sh", "-c", shellString,
194 194
 		}
195 195
 	}
196
-	log.Debugf("lxc params %s", params)
196
+	logrus.Debugf("lxc params %s", params)
197 197
 	var (
198 198
 		name = params[0]
199 199
 		arg  = params[1:]
... ...
@@ -263,7 +263,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
263 263
 	c.ContainerPid = pid
264 264
 
265 265
 	if startCallback != nil {
266
-		log.Debugf("Invoking startCallback")
266
+		logrus.Debugf("Invoking startCallback")
267 267
 		startCallback(&c.ProcessConfig, pid)
268 268
 	}
269 269
 
... ...
@@ -274,9 +274,9 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
274 274
 
275 275
 	if err == nil {
276 276
 		_, oomKill = <-oomKillNotification
277
-		log.Debugf("oomKill error %s waitErr %s", oomKill, waitErr)
277
+		logrus.Debugf("oomKill error %s waitErr %s", oomKill, waitErr)
278 278
 	} else {
279
-		log.Warnf("Your kernel does not support OOM notifications: %s", err)
279
+		logrus.Warnf("Your kernel does not support OOM notifications: %s", err)
280 280
 	}
281 281
 
282 282
 	// check oom error
... ...
@@ -351,11 +351,11 @@ func cgroupPaths(containerId string) (map[string]string, error) {
351 351
 	if err != nil {
352 352
 		return nil, err
353 353
 	}
354
-	log.Debugf("subsystems: %s", subsystems)
354
+	logrus.Debugf("subsystems: %s", subsystems)
355 355
 	paths := make(map[string]string)
356 356
 	for _, subsystem := range subsystems {
357 357
 		cgroupRoot, cgroupDir, err := findCgroupRootAndDir(subsystem)
358
-		log.Debugf("cgroup path %s %s", cgroupRoot, cgroupDir)
358
+		logrus.Debugf("cgroup path %s %s", cgroupRoot, cgroupDir)
359 359
 		if err != nil {
360 360
 			//unsupported subystem
361 361
 			continue
... ...
@@ -576,7 +576,7 @@ func (i *info) IsRunning() bool {
576 576
 
577 577
 	output, err := i.driver.getInfo(i.ID)
578 578
 	if err != nil {
579
-		log.Errorf("Error getting info for lxc container %s: %s (%s)", i.ID, err, output)
579
+		logrus.Errorf("Error getting info for lxc container %s: %s (%s)", i.ID, err, output)
580 580
 		return false
581 581
 	}
582 582
 	if strings.Contains(string(output), "RUNNING") {
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"strings"
7 7
 	"text/template"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/daemon/execdriver"
11 11
 	nativeTemplate "github.com/docker/docker/daemon/execdriver/native/template"
12 12
 	"github.com/docker/docker/utils"
... ...
@@ -160,14 +160,14 @@ func escapeFstabSpaces(field string) string {
160 160
 
161 161
 func keepCapabilities(adds []string, drops []string) ([]string, error) {
162 162
 	container := nativeTemplate.New()
163
-	log.Debugf("adds %s drops %s\n", adds, drops)
163
+	logrus.Debugf("adds %s drops %s\n", adds, drops)
164 164
 	caps, err := execdriver.TweakCapabilities(container.Capabilities, adds, drops)
165 165
 	if err != nil {
166 166
 		return nil, err
167 167
 	}
168 168
 	var newCaps []string
169 169
 	for _, cap := range caps {
170
-		log.Debugf("cap %s\n", cap)
170
+		logrus.Debugf("cap %s\n", cap)
171 171
 		realCap := execdriver.GetCapability(cap)
172 172
 		numCap := fmt.Sprintf("%d", realCap.Value)
173 173
 		newCaps = append(newCaps, numCap)
... ...
@@ -181,7 +181,7 @@ func dropList(drops []string) ([]string, error) {
181 181
 		var newCaps []string
182 182
 		for _, capName := range execdriver.GetAllCapabilities() {
183 183
 			cap := execdriver.GetCapability(capName)
184
-			log.Debugf("drop cap %s\n", cap.Key)
184
+			logrus.Debugf("drop cap %s\n", cap.Key)
185 185
 			numCap := fmt.Sprintf("%d", cap.Value)
186 186
 			newCaps = append(newCaps, numCap)
187 187
 		}
... ...
@@ -192,7 +192,7 @@ func dropList(drops []string) ([]string, error) {
192 192
 
193 193
 func isDirectory(source string) string {
194 194
 	f, err := os.Stat(source)
195
-	log.Debugf("dir: %s\n", source)
195
+	logrus.Debugf("dir: %s\n", source)
196 196
 	if err != nil {
197 197
 		if os.IsNotExist(err) {
198 198
 			return "dir"
... ...
@@ -15,7 +15,7 @@ import (
15 15
 	"syscall"
16 16
 	"time"
17 17
 
18
-	log "github.com/Sirupsen/logrus"
18
+	"github.com/Sirupsen/logrus"
19 19
 	"github.com/docker/docker/daemon/execdriver"
20 20
 	"github.com/docker/docker/pkg/reexec"
21 21
 	sysinfo "github.com/docker/docker/pkg/system"
... ...
@@ -159,7 +159,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
159 159
 	oomKillNotification, err := cont.NotifyOOM()
160 160
 	if err != nil {
161 161
 		oomKillNotification = nil
162
-		log.Warnf("Your kernel does not support OOM notifications: %s", err)
162
+		logrus.Warnf("Your kernel does not support OOM notifications: %s", err)
163 163
 	}
164 164
 	waitF := p.Wait
165 165
 	if nss := cont.Config().Namespaces; nss.Contains(configs.NEWPID) {
... ...
@@ -206,7 +206,7 @@ func waitInPIDHost(p *libcontainer.Process, c libcontainer.Container) func() (*o
206 206
 		for _, pid := range processes {
207 207
 			process, err := os.FindProcess(pid)
208 208
 			if err != nil {
209
-				log.Errorf("Failed to kill process: %d", pid)
209
+				logrus.Errorf("Failed to kill process: %d", pid)
210 210
 				continue
211 211
 			}
212 212
 			process.Kill()
... ...
@@ -30,7 +30,7 @@ import (
30 30
 	"sync"
31 31
 	"syscall"
32 32
 
33
-	log "github.com/Sirupsen/logrus"
33
+	"github.com/Sirupsen/logrus"
34 34
 	"github.com/docker/docker/daemon/graphdriver"
35 35
 	"github.com/docker/docker/pkg/archive"
36 36
 	"github.com/docker/docker/pkg/chrootarchive"
... ...
@@ -216,7 +216,7 @@ func (a *Driver) Remove(id string) error {
216 216
 	defer a.Unlock()
217 217
 
218 218
 	if a.active[id] != 0 {
219
-		log.Errorf("Removing active id %s", id)
219
+		logrus.Errorf("Removing active id %s", id)
220 220
 	}
221 221
 
222 222
 	// Make sure the dir is umounted first
... ...
@@ -405,7 +405,7 @@ func (a *Driver) Cleanup() error {
405 405
 
406 406
 	for _, id := range ids {
407 407
 		if err := a.unmount(id); err != nil {
408
-			log.Errorf("Unmounting %s: %s", stringid.TruncateID(id), err)
408
+			logrus.Errorf("Unmounting %s: %s", stringid.TruncateID(id), err)
409 409
 		}
410 410
 	}
411 411
 
... ...
@@ -4,12 +4,12 @@ import (
4 4
 	"os/exec"
5 5
 	"syscall"
6 6
 
7
-	log "github.com/Sirupsen/logrus"
7
+	"github.com/Sirupsen/logrus"
8 8
 )
9 9
 
10 10
 func Unmount(target string) error {
11 11
 	if err := exec.Command("auplink", target, "flush").Run(); err != nil {
12
-		log.Errorf("Couldn't run auplink before unmount: %s", err)
12
+		logrus.Errorf("Couldn't run auplink before unmount: %s", err)
13 13
 	}
14 14
 	if err := syscall.Unmount(target, 0); err != nil {
15 15
 		return err
... ...
@@ -18,7 +18,7 @@ import (
18 18
 	"syscall"
19 19
 	"time"
20 20
 
21
-	log "github.com/Sirupsen/logrus"
21
+	"github.com/Sirupsen/logrus"
22 22
 	"github.com/docker/docker/daemon/graphdriver"
23 23
 	"github.com/docker/docker/pkg/devicemapper"
24 24
 	"github.com/docker/docker/pkg/parsers"
... ...
@@ -205,7 +205,7 @@ func (devices *DeviceSet) ensureImage(name string, size int64) (string, error) {
205 205
 		if !os.IsNotExist(err) {
206 206
 			return "", err
207 207
 		}
208
-		log.Debugf("Creating loopback file %s for device-manage use", filename)
208
+		logrus.Debugf("Creating loopback file %s for device-manage use", filename)
209 209
 		file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0600)
210 210
 		if err != nil {
211 211
 			return "", err
... ...
@@ -320,21 +320,21 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo)
320 320
 
321 321
 	// Skip some of the meta files which are not device files.
322 322
 	if strings.HasSuffix(finfo.Name(), ".migrated") {
323
-		log.Debugf("Skipping file %s", path)
323
+		logrus.Debugf("Skipping file %s", path)
324 324
 		return nil
325 325
 	}
326 326
 
327 327
 	if strings.HasPrefix(finfo.Name(), ".") {
328
-		log.Debugf("Skipping file %s", path)
328
+		logrus.Debugf("Skipping file %s", path)
329 329
 		return nil
330 330
 	}
331 331
 
332 332
 	if finfo.Name() == deviceSetMetaFile {
333
-		log.Debugf("Skipping file %s", path)
333
+		logrus.Debugf("Skipping file %s", path)
334 334
 		return nil
335 335
 	}
336 336
 
337
-	log.Debugf("Loading data for file %s", path)
337
+	logrus.Debugf("Loading data for file %s", path)
338 338
 
339 339
 	hash := finfo.Name()
340 340
 	if hash == "base" {
... ...
@@ -347,7 +347,7 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo)
347 347
 	}
348 348
 
349 349
 	if dinfo.DeviceId > MaxDeviceId {
350
-		log.Errorf("Ignoring Invalid DeviceId=%d", dinfo.DeviceId)
350
+		logrus.Errorf("Ignoring Invalid DeviceId=%d", dinfo.DeviceId)
351 351
 		return nil
352 352
 	}
353 353
 
... ...
@@ -355,17 +355,17 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo)
355 355
 	devices.markDeviceIdUsed(dinfo.DeviceId)
356 356
 	devices.Unlock()
357 357
 
358
-	log.Debugf("Added deviceId=%d to DeviceIdMap", dinfo.DeviceId)
358
+	logrus.Debugf("Added deviceId=%d to DeviceIdMap", dinfo.DeviceId)
359 359
 	return nil
360 360
 }
361 361
 
362 362
 func (devices *DeviceSet) constructDeviceIdMap() error {
363
-	log.Debugf("[deviceset] constructDeviceIdMap()")
364
-	defer log.Debugf("[deviceset] constructDeviceIdMap() END")
363
+	logrus.Debugf("[deviceset] constructDeviceIdMap()")
364
+	defer logrus.Debugf("[deviceset] constructDeviceIdMap() END")
365 365
 
366 366
 	var scan = func(path string, info os.FileInfo, err error) error {
367 367
 		if err != nil {
368
-			log.Debugf("Can't walk the file %s", path)
368
+			logrus.Debugf("Can't walk the file %s", path)
369 369
 			return nil
370 370
 		}
371 371
 
... ...
@@ -381,7 +381,7 @@ func (devices *DeviceSet) constructDeviceIdMap() error {
381 381
 }
382 382
 
383 383
 func (devices *DeviceSet) unregisterDevice(id int, hash string) error {
384
-	log.Debugf("unregisterDevice(%v, %v)", id, hash)
384
+	logrus.Debugf("unregisterDevice(%v, %v)", id, hash)
385 385
 	info := &DevInfo{
386 386
 		Hash:     hash,
387 387
 		DeviceId: id,
... ...
@@ -392,7 +392,7 @@ func (devices *DeviceSet) unregisterDevice(id int, hash string) error {
392 392
 	devices.devicesLock.Unlock()
393 393
 
394 394
 	if err := devices.removeMetadata(info); err != nil {
395
-		log.Debugf("Error removing metadata: %s", err)
395
+		logrus.Debugf("Error removing metadata: %s", err)
396 396
 		return err
397 397
 	}
398 398
 
... ...
@@ -400,7 +400,7 @@ func (devices *DeviceSet) unregisterDevice(id int, hash string) error {
400 400
 }
401 401
 
402 402
 func (devices *DeviceSet) registerDevice(id int, hash string, size uint64, transactionId uint64) (*DevInfo, error) {
403
-	log.Debugf("registerDevice(%v, %v)", id, hash)
403
+	logrus.Debugf("registerDevice(%v, %v)", id, hash)
404 404
 	info := &DevInfo{
405 405
 		Hash:          hash,
406 406
 		DeviceId:      id,
... ...
@@ -426,7 +426,7 @@ func (devices *DeviceSet) registerDevice(id int, hash string, size uint64, trans
426 426
 }
427 427
 
428 428
 func (devices *DeviceSet) activateDeviceIfNeeded(info *DevInfo) error {
429
-	log.Debugf("activateDeviceIfNeeded(%v)", info.Hash)
429
+	logrus.Debugf("activateDeviceIfNeeded(%v)", info.Hash)
430 430
 
431 431
 	if devinfo, _ := devicemapper.GetInfo(info.Name()); devinfo != nil && devinfo.Exists != 0 {
432 432
 		return nil
... ...
@@ -542,7 +542,7 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*DevInfo, error) {
542 542
 	}
543 543
 
544 544
 	if err := devices.openTransaction(hash, deviceId); err != nil {
545
-		log.Debugf("Error opening transaction hash = %s deviceId = %d", hash, deviceId)
545
+		logrus.Debugf("Error opening transaction hash = %s deviceId = %d", hash, deviceId)
546 546
 		devices.markDeviceIdFree(deviceId)
547 547
 		return nil, err
548 548
 	}
... ...
@@ -554,7 +554,7 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*DevInfo, error) {
554 554
 				// happen. Now we have a mechianism to find
555 555
 				// a free device Id. So something is not right.
556 556
 				// Give a warning and continue.
557
-				log.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
557
+				logrus.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
558 558
 				deviceId, err = devices.getNextFreeDeviceId()
559 559
 				if err != nil {
560 560
 					return nil, err
... ...
@@ -563,14 +563,14 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*DevInfo, error) {
563 563
 				devices.refreshTransaction(deviceId)
564 564
 				continue
565 565
 			}
566
-			log.Debugf("Error creating device: %s", err)
566
+			logrus.Debugf("Error creating device: %s", err)
567 567
 			devices.markDeviceIdFree(deviceId)
568 568
 			return nil, err
569 569
 		}
570 570
 		break
571 571
 	}
572 572
 
573
-	log.Debugf("Registering device (id %v) with FS size %v", deviceId, devices.baseFsSize)
573
+	logrus.Debugf("Registering device (id %v) with FS size %v", deviceId, devices.baseFsSize)
574 574
 	info, err := devices.registerDevice(deviceId, hash, devices.baseFsSize, devices.OpenTransactionId)
575 575
 	if err != nil {
576 576
 		_ = devicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)
... ...
@@ -594,7 +594,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInf
594 594
 	}
595 595
 
596 596
 	if err := devices.openTransaction(hash, deviceId); err != nil {
597
-		log.Debugf("Error opening transaction hash = %s deviceId = %d", hash, deviceId)
597
+		logrus.Debugf("Error opening transaction hash = %s deviceId = %d", hash, deviceId)
598 598
 		devices.markDeviceIdFree(deviceId)
599 599
 		return err
600 600
 	}
... ...
@@ -606,7 +606,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInf
606 606
 				// happen. Now we have a mechianism to find
607 607
 				// a free device Id. So something is not right.
608 608
 				// Give a warning and continue.
609
-				log.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
609
+				logrus.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
610 610
 				deviceId, err = devices.getNextFreeDeviceId()
611 611
 				if err != nil {
612 612
 					return err
... ...
@@ -615,7 +615,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInf
615 615
 				devices.refreshTransaction(deviceId)
616 616
 				continue
617 617
 			}
618
-			log.Debugf("Error creating snap device: %s", err)
618
+			logrus.Debugf("Error creating snap device: %s", err)
619 619
 			devices.markDeviceIdFree(deviceId)
620 620
 			return err
621 621
 		}
... ...
@@ -625,7 +625,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInf
625 625
 	if _, err := devices.registerDevice(deviceId, hash, baseInfo.Size, devices.OpenTransactionId); err != nil {
626 626
 		devicemapper.DeleteDevice(devices.getPoolDevName(), deviceId)
627 627
 		devices.markDeviceIdFree(deviceId)
628
-		log.Debugf("Error registering device: %s", err)
628
+		logrus.Debugf("Error registering device: %s", err)
629 629
 		return err
630 630
 	}
631 631
 
... ...
@@ -660,7 +660,7 @@ func (devices *DeviceSet) setupBaseImage() error {
660 660
 	}
661 661
 
662 662
 	if oldInfo != nil && !oldInfo.Initialized {
663
-		log.Debugf("Removing uninitialized base image")
663
+		logrus.Debugf("Removing uninitialized base image")
664 664
 		if err := devices.DeleteDevice(""); err != nil {
665 665
 			return err
666 666
 		}
... ...
@@ -681,7 +681,7 @@ func (devices *DeviceSet) setupBaseImage() error {
681 681
 		}
682 682
 	}
683 683
 
684
-	log.Debugf("Initializing base device-mapper thin volume")
684
+	logrus.Debugf("Initializing base device-mapper thin volume")
685 685
 
686 686
 	// Create initial device
687 687
 	info, err := devices.createRegisterDevice("")
... ...
@@ -689,7 +689,7 @@ func (devices *DeviceSet) setupBaseImage() error {
689 689
 		return err
690 690
 	}
691 691
 
692
-	log.Debugf("Creating filesystem on base device-mapper thin volume")
692
+	logrus.Debugf("Creating filesystem on base device-mapper thin volume")
693 693
 
694 694
 	if err = devices.activateDeviceIfNeeded(info); err != nil {
695 695
 		return err
... ...
@@ -730,7 +730,7 @@ func (devices *DeviceSet) DMLog(level int, file string, line int, dmError int, m
730 730
 	}
731 731
 
732 732
 	// FIXME(vbatts) push this back into ./pkg/devicemapper/
733
-	log.Debugf("libdevmapper(%d): %s:%d (%d) %s", level, file, line, dmError, message)
733
+	logrus.Debugf("libdevmapper(%d): %s:%d (%d) %s", level, file, line, dmError, message)
734 734
 }
735 735
 
736 736
 func major(device uint64) uint64 {
... ...
@@ -846,24 +846,24 @@ func (devices *DeviceSet) removeTransactionMetaData() error {
846 846
 }
847 847
 
848 848
 func (devices *DeviceSet) rollbackTransaction() error {
849
-	log.Debugf("Rolling back open transaction: TransactionId=%d hash=%s device_id=%d", devices.OpenTransactionId, devices.DeviceIdHash, devices.DeviceId)
849
+	logrus.Debugf("Rolling back open transaction: TransactionId=%d hash=%s device_id=%d", devices.OpenTransactionId, devices.DeviceIdHash, devices.DeviceId)
850 850
 
851 851
 	// A device id might have already been deleted before transaction
852 852
 	// closed. In that case this call will fail. Just leave a message
853 853
 	// in case of failure.
854 854
 	if err := devicemapper.DeleteDevice(devices.getPoolDevName(), devices.DeviceId); err != nil {
855
-		log.Errorf("Unable to delete device: %s", err)
855
+		logrus.Errorf("Unable to delete device: %s", err)
856 856
 	}
857 857
 
858 858
 	dinfo := &DevInfo{Hash: devices.DeviceIdHash}
859 859
 	if err := devices.removeMetadata(dinfo); err != nil {
860
-		log.Errorf("Unable to remove metadata: %s", err)
860
+		logrus.Errorf("Unable to remove metadata: %s", err)
861 861
 	} else {
862 862
 		devices.markDeviceIdFree(devices.DeviceId)
863 863
 	}
864 864
 
865 865
 	if err := devices.removeTransactionMetaData(); err != nil {
866
-		log.Errorf("Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
866
+		logrus.Errorf("Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
867 867
 	}
868 868
 
869 869
 	return nil
... ...
@@ -883,7 +883,7 @@ func (devices *DeviceSet) processPendingTransaction() error {
883 883
 	// If open transaction Id is less than pool transaction Id, something
884 884
 	// is wrong. Bail out.
885 885
 	if devices.OpenTransactionId < devices.TransactionId {
886
-		log.Errorf("Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionId, devices.TransactionId)
886
+		logrus.Errorf("Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionId, devices.TransactionId)
887 887
 		return nil
888 888
 	}
889 889
 
... ...
@@ -940,7 +940,7 @@ func (devices *DeviceSet) refreshTransaction(DeviceId int) error {
940 940
 
941 941
 func (devices *DeviceSet) closeTransaction() error {
942 942
 	if err := devices.updatePoolTransactionId(); err != nil {
943
-		log.Debugf("Failed to close Transaction")
943
+		logrus.Debugf("Failed to close Transaction")
944 944
 		return err
945 945
 	}
946 946
 	return nil
... ...
@@ -963,9 +963,9 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
963 963
 
964 964
 	// https://github.com/docker/docker/issues/4036
965 965
 	if supported := devicemapper.UdevSetSyncSupport(true); !supported {
966
-		log.Warnf("Udev sync is not supported. This will lead to unexpected behavior, data loss and errors")
966
+		logrus.Warnf("Udev sync is not supported. This will lead to unexpected behavior, data loss and errors")
967 967
 	}
968
-	log.Debugf("devicemapper: udev sync support: %v", devicemapper.UdevSyncSupported())
968
+	logrus.Debugf("devicemapper: udev sync support: %v", devicemapper.UdevSyncSupported())
969 969
 
970 970
 	if err := os.MkdirAll(devices.metadataDir(), 0700); err != nil && !os.IsExist(err) {
971 971
 		return err
... ...
@@ -985,13 +985,13 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
985 985
 	//	- The target of this device is at major <maj> and minor <min>
986 986
 	//	- If <inode> is defined, use that file inside the device as a loopback image. Otherwise use the device itself.
987 987
 	devices.devicePrefix = fmt.Sprintf("docker-%d:%d-%d", major(sysSt.Dev), minor(sysSt.Dev), sysSt.Ino)
988
-	log.Debugf("Generated prefix: %s", devices.devicePrefix)
988
+	logrus.Debugf("Generated prefix: %s", devices.devicePrefix)
989 989
 
990 990
 	// Check for the existence of the thin-pool device
991
-	log.Debugf("Checking for existence of the pool '%s'", devices.getPoolName())
991
+	logrus.Debugf("Checking for existence of the pool '%s'", devices.getPoolName())
992 992
 	info, err := devicemapper.GetInfo(devices.getPoolName())
993 993
 	if info == nil {
994
-		log.Debugf("Error device devicemapper.GetInfo: %s", err)
994
+		logrus.Debugf("Error device devicemapper.GetInfo: %s", err)
995 995
 		return err
996 996
 	}
997 997
 
... ...
@@ -1007,7 +1007,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
1007 1007
 
1008 1008
 	// If the pool doesn't exist, create it
1009 1009
 	if info.Exists == 0 && devices.thinPoolDevice == "" {
1010
-		log.Debugf("Pool doesn't exist. Creating it.")
1010
+		logrus.Debugf("Pool doesn't exist. Creating it.")
1011 1011
 
1012 1012
 		var (
1013 1013
 			dataFile     *os.File
... ...
@@ -1029,7 +1029,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
1029 1029
 
1030 1030
 			data, err := devices.ensureImage("data", devices.dataLoopbackSize)
1031 1031
 			if err != nil {
1032
-				log.Debugf("Error device ensureImage (data): %s", err)
1032
+				logrus.Debugf("Error device ensureImage (data): %s", err)
1033 1033
 				return err
1034 1034
 			}
1035 1035
 
... ...
@@ -1062,7 +1062,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
1062 1062
 
1063 1063
 			metadata, err := devices.ensureImage("metadata", devices.metaDataLoopbackSize)
1064 1064
 			if err != nil {
1065
-				log.Debugf("Error device ensureImage (metadata): %s", err)
1065
+				logrus.Debugf("Error device ensureImage (metadata): %s", err)
1066 1066
 				return err
1067 1067
 			}
1068 1068
 
... ...
@@ -1102,7 +1102,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
1102 1102
 	// Setup the base image
1103 1103
 	if doInit {
1104 1104
 		if err := devices.setupBaseImage(); err != nil {
1105
-			log.Debugf("Error device setupBaseImage: %s", err)
1105
+			logrus.Debugf("Error device setupBaseImage: %s", err)
1106 1106
 			return err
1107 1107
 		}
1108 1108
 	}
... ...
@@ -1111,8 +1111,8 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
1111 1111
 }
1112 1112
 
1113 1113
 func (devices *DeviceSet) AddDevice(hash, baseHash string) error {
1114
-	log.Debugf("[deviceset] AddDevice(hash=%s basehash=%s)", hash, baseHash)
1115
-	defer log.Debugf("[deviceset] AddDevice(hash=%s basehash=%s) END", hash, baseHash)
1114
+	logrus.Debugf("[deviceset] AddDevice(hash=%s basehash=%s)", hash, baseHash)
1115
+	defer logrus.Debugf("[deviceset] AddDevice(hash=%s basehash=%s) END", hash, baseHash)
1116 1116
 
1117 1117
 	baseInfo, err := devices.lookupDevice(baseHash)
1118 1118
 	if err != nil {
... ...
@@ -1143,7 +1143,7 @@ func (devices *DeviceSet) deleteDevice(info *DevInfo) error {
1143 1143
 		// manually
1144 1144
 		if err := devices.activateDeviceIfNeeded(info); err == nil {
1145 1145
 			if err := devicemapper.BlockDeviceDiscard(info.DevName()); err != nil {
1146
-				log.Debugf("Error discarding block on device: %s (ignoring)", err)
1146
+				logrus.Debugf("Error discarding block on device: %s (ignoring)", err)
1147 1147
 			}
1148 1148
 		}
1149 1149
 	}
... ...
@@ -1151,18 +1151,18 @@ func (devices *DeviceSet) deleteDevice(info *DevInfo) error {
1151 1151
 	devinfo, _ := devicemapper.GetInfo(info.Name())
1152 1152
 	if devinfo != nil && devinfo.Exists != 0 {
1153 1153
 		if err := devices.removeDeviceAndWait(info.Name()); err != nil {
1154
-			log.Debugf("Error removing device: %s", err)
1154
+			logrus.Debugf("Error removing device: %s", err)
1155 1155
 			return err
1156 1156
 		}
1157 1157
 	}
1158 1158
 
1159 1159
 	if err := devices.openTransaction(info.Hash, info.DeviceId); err != nil {
1160
-		log.Debugf("Error opening transaction hash = %s deviceId = %d", "", info.DeviceId)
1160
+		logrus.Debugf("Error opening transaction hash = %s deviceId = %d", "", info.DeviceId)
1161 1161
 		return err
1162 1162
 	}
1163 1163
 
1164 1164
 	if err := devicemapper.DeleteDevice(devices.getPoolDevName(), info.DeviceId); err != nil {
1165
-		log.Debugf("Error deleting device: %s", err)
1165
+		logrus.Debugf("Error deleting device: %s", err)
1166 1166
 		return err
1167 1167
 	}
1168 1168
 
... ...
@@ -1195,8 +1195,8 @@ func (devices *DeviceSet) DeleteDevice(hash string) error {
1195 1195
 }
1196 1196
 
1197 1197
 func (devices *DeviceSet) deactivatePool() error {
1198
-	log.Debugf("[devmapper] deactivatePool()")
1199
-	defer log.Debugf("[devmapper] deactivatePool END")
1198
+	logrus.Debugf("[devmapper] deactivatePool()")
1199
+	defer logrus.Debugf("[devmapper] deactivatePool END")
1200 1200
 	devname := devices.getPoolDevName()
1201 1201
 
1202 1202
 	devinfo, err := devicemapper.GetInfo(devname)
... ...
@@ -1205,7 +1205,7 @@ func (devices *DeviceSet) deactivatePool() error {
1205 1205
 	}
1206 1206
 	if d, err := devicemapper.GetDeps(devname); err == nil {
1207 1207
 		// Access to more Debug output
1208
-		log.Debugf("[devmapper] devicemapper.GetDeps() %s: %#v", devname, d)
1208
+		logrus.Debugf("[devmapper] devicemapper.GetDeps() %s: %#v", devname, d)
1209 1209
 	}
1210 1210
 	if devinfo.Exists != 0 {
1211 1211
 		return devicemapper.RemoveDevice(devname)
... ...
@@ -1215,13 +1215,13 @@ func (devices *DeviceSet) deactivatePool() error {
1215 1215
 }
1216 1216
 
1217 1217
 func (devices *DeviceSet) deactivateDevice(info *DevInfo) error {
1218
-	log.Debugf("[devmapper] deactivateDevice(%s)", info.Hash)
1219
-	defer log.Debugf("[devmapper] deactivateDevice END(%s)", info.Hash)
1218
+	logrus.Debugf("[devmapper] deactivateDevice(%s)", info.Hash)
1219
+	defer logrus.Debugf("[devmapper] deactivateDevice END(%s)", info.Hash)
1220 1220
 
1221 1221
 	// Wait for the unmount to be effective,
1222 1222
 	// by watching the value of Info.OpenCount for the device
1223 1223
 	if err := devices.waitClose(info); err != nil {
1224
-		log.Errorf("Error waiting for device %s to close: %s", info.Hash, err)
1224
+		logrus.Errorf("Error waiting for device %s to close: %s", info.Hash, err)
1225 1225
 	}
1226 1226
 
1227 1227
 	devinfo, err := devicemapper.GetInfo(info.Name())
... ...
@@ -1271,8 +1271,8 @@ func (devices *DeviceSet) removeDeviceAndWait(devname string) error {
1271 1271
 // a) the device registered at <device_set_prefix>-<hash> is removed,
1272 1272
 // or b) the 10 second timeout expires.
1273 1273
 func (devices *DeviceSet) waitRemove(devname string) error {
1274
-	log.Debugf("[deviceset %s] waitRemove(%s)", devices.devicePrefix, devname)
1275
-	defer log.Debugf("[deviceset %s] waitRemove(%s) END", devices.devicePrefix, devname)
1274
+	logrus.Debugf("[deviceset %s] waitRemove(%s)", devices.devicePrefix, devname)
1275
+	defer logrus.Debugf("[deviceset %s] waitRemove(%s) END", devices.devicePrefix, devname)
1276 1276
 	i := 0
1277 1277
 	for ; i < 1000; i++ {
1278 1278
 		devinfo, err := devicemapper.GetInfo(devname)
... ...
@@ -1282,7 +1282,7 @@ func (devices *DeviceSet) waitRemove(devname string) error {
1282 1282
 			return nil
1283 1283
 		}
1284 1284
 		if i%100 == 0 {
1285
-			log.Debugf("Waiting for removal of %s: exists=%d", devname, devinfo.Exists)
1285
+			logrus.Debugf("Waiting for removal of %s: exists=%d", devname, devinfo.Exists)
1286 1286
 		}
1287 1287
 		if devinfo.Exists == 0 {
1288 1288
 			break
... ...
@@ -1309,7 +1309,7 @@ func (devices *DeviceSet) waitClose(info *DevInfo) error {
1309 1309
 			return err
1310 1310
 		}
1311 1311
 		if i%100 == 0 {
1312
-			log.Debugf("Waiting for unmount of %s: opencount=%d", info.Hash, devinfo.OpenCount)
1312
+			logrus.Debugf("Waiting for unmount of %s: opencount=%d", info.Hash, devinfo.OpenCount)
1313 1313
 		}
1314 1314
 		if devinfo.OpenCount == 0 {
1315 1315
 			break
... ...
@@ -1325,9 +1325,9 @@ func (devices *DeviceSet) waitClose(info *DevInfo) error {
1325 1325
 }
1326 1326
 
1327 1327
 func (devices *DeviceSet) Shutdown() error {
1328
-	log.Debugf("[deviceset %s] Shutdown()", devices.devicePrefix)
1329
-	log.Debugf("[devmapper] Shutting down DeviceSet: %s", devices.root)
1330
-	defer log.Debugf("[deviceset %s] Shutdown() END", devices.devicePrefix)
1328
+	logrus.Debugf("[deviceset %s] Shutdown()", devices.devicePrefix)
1329
+	logrus.Debugf("[devmapper] Shutting down DeviceSet: %s", devices.root)
1330
+	defer logrus.Debugf("[deviceset %s] Shutdown() END", devices.devicePrefix)
1331 1331
 
1332 1332
 	var devs []*DevInfo
1333 1333
 
... ...
@@ -1344,12 +1344,12 @@ func (devices *DeviceSet) Shutdown() error {
1344 1344
 			// container. This means it'll go away from the global scope directly,
1345 1345
 			// and the device will be released when that container dies.
1346 1346
 			if err := syscall.Unmount(info.mountPath, syscall.MNT_DETACH); err != nil {
1347
-				log.Debugf("Shutdown unmounting %s, error: %s", info.mountPath, err)
1347
+				logrus.Debugf("Shutdown unmounting %s, error: %s", info.mountPath, err)
1348 1348
 			}
1349 1349
 
1350 1350
 			devices.Lock()
1351 1351
 			if err := devices.deactivateDevice(info); err != nil {
1352
-				log.Debugf("Shutdown deactivate %s , error: %s", info.Hash, err)
1352
+				logrus.Debugf("Shutdown deactivate %s , error: %s", info.Hash, err)
1353 1353
 			}
1354 1354
 			devices.Unlock()
1355 1355
 		}
... ...
@@ -1361,7 +1361,7 @@ func (devices *DeviceSet) Shutdown() error {
1361 1361
 		info.lock.Lock()
1362 1362
 		devices.Lock()
1363 1363
 		if err := devices.deactivateDevice(info); err != nil {
1364
-			log.Debugf("Shutdown deactivate base , error: %s", err)
1364
+			logrus.Debugf("Shutdown deactivate base , error: %s", err)
1365 1365
 		}
1366 1366
 		devices.Unlock()
1367 1367
 		info.lock.Unlock()
... ...
@@ -1370,7 +1370,7 @@ func (devices *DeviceSet) Shutdown() error {
1370 1370
 	devices.Lock()
1371 1371
 	if devices.thinPoolDevice == "" {
1372 1372
 		if err := devices.deactivatePool(); err != nil {
1373
-			log.Debugf("Shutdown deactivate pool , error: %s", err)
1373
+			logrus.Debugf("Shutdown deactivate pool , error: %s", err)
1374 1374
 		}
1375 1375
 	}
1376 1376
 
... ...
@@ -1437,8 +1437,8 @@ func (devices *DeviceSet) MountDevice(hash, path, mountLabel string) error {
1437 1437
 }
1438 1438
 
1439 1439
 func (devices *DeviceSet) UnmountDevice(hash string) error {
1440
-	log.Debugf("[devmapper] UnmountDevice(hash=%s)", hash)
1441
-	defer log.Debugf("[devmapper] UnmountDevice(hash=%s) END", hash)
1440
+	logrus.Debugf("[devmapper] UnmountDevice(hash=%s)", hash)
1441
+	defer logrus.Debugf("[devmapper] UnmountDevice(hash=%s) END", hash)
1442 1442
 
1443 1443
 	info, err := devices.lookupDevice(hash)
1444 1444
 	if err != nil {
... ...
@@ -1460,11 +1460,11 @@ func (devices *DeviceSet) UnmountDevice(hash string) error {
1460 1460
 		return nil
1461 1461
 	}
1462 1462
 
1463
-	log.Debugf("[devmapper] Unmount(%s)", info.mountPath)
1463
+	logrus.Debugf("[devmapper] Unmount(%s)", info.mountPath)
1464 1464
 	if err := syscall.Unmount(info.mountPath, syscall.MNT_DETACH); err != nil {
1465 1465
 		return err
1466 1466
 	}
1467
-	log.Debugf("[devmapper] Unmount done")
1467
+	logrus.Debugf("[devmapper] Unmount done")
1468 1468
 
1469 1469
 	if err := devices.deactivateDevice(info); err != nil {
1470 1470
 		return err
... ...
@@ -1586,7 +1586,7 @@ func (devices *DeviceSet) getUnderlyingAvailableSpace(loopFile string) (uint64,
1586 1586
 	buf := new(syscall.Statfs_t)
1587 1587
 	err := syscall.Statfs(loopFile, buf)
1588 1588
 	if err != nil {
1589
-		log.Warnf("Couldn't stat loopfile filesystem %v: %v", loopFile, err)
1589
+		logrus.Warnf("Couldn't stat loopfile filesystem %v: %v", loopFile, err)
1590 1590
 		return 0, err
1591 1591
 	}
1592 1592
 	return buf.Bfree * uint64(buf.Bsize), nil
... ...
@@ -1596,7 +1596,7 @@ func (devices *DeviceSet) isRealFile(loopFile string) (bool, error) {
1596 1596
 	if loopFile != "" {
1597 1597
 		fi, err := os.Stat(loopFile)
1598 1598
 		if err != nil {
1599
-			log.Warnf("Couldn't stat loopfile %v: %v", loopFile, err)
1599
+			logrus.Warnf("Couldn't stat loopfile %v: %v", loopFile, err)
1600 1600
 			return false, err
1601 1601
 		}
1602 1602
 		return fi.Mode().IsRegular(), nil
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"os"
9 9
 	"path"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/daemon/graphdriver"
13 13
 	"github.com/docker/docker/pkg/devicemapper"
14 14
 	"github.com/docker/docker/pkg/mount"
... ...
@@ -164,7 +164,7 @@ func (d *Driver) Get(id, mountLabel string) (string, error) {
164 164
 func (d *Driver) Put(id string) error {
165 165
 	err := d.DeviceSet.UnmountDevice(id)
166 166
 	if err != nil {
167
-		log.Errorf("Error unmounting device %s: %s", id, err)
167
+		logrus.Errorf("Error unmounting device %s: %s", id, err)
168 168
 	}
169 169
 	return err
170 170
 }
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"path"
8 8
 	"strings"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 	"github.com/docker/docker/pkg/archive"
12 12
 )
13 13
 
... ...
@@ -184,6 +184,6 @@ func checkPriorDriver(name, root string) {
184 184
 		}
185 185
 	}
186 186
 	if len(priorDrivers) > 0 {
187
-		log.Warnf("Graphdriver %s selected. Your graphdriver directory %s already contains data managed by other graphdrivers: %s", name, root, strings.Join(priorDrivers, ","))
187
+		logrus.Warnf("Graphdriver %s selected. Your graphdriver directory %s already contains data managed by other graphdrivers: %s", name, root, strings.Join(priorDrivers, ","))
188 188
 	}
189 189
 }
... ...
@@ -5,7 +5,7 @@ package graphdriver
5 5
 import (
6 6
 	"time"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/pkg/archive"
10 10
 	"github.com/docker/docker/pkg/chrootarchive"
11 11
 	"github.com/docker/docker/pkg/ioutils"
... ...
@@ -120,11 +120,11 @@ func (gdw *naiveDiffDriver) ApplyDiff(id, parent string, diff archive.ArchiveRea
120 120
 	defer driver.Put(id)
121 121
 
122 122
 	start := time.Now().UTC()
123
-	log.Debugf("Start untar layer")
123
+	logrus.Debugf("Start untar layer")
124 124
 	if size, err = chrootarchive.ApplyLayer(layerFs, diff); err != nil {
125 125
 		return
126 126
 	}
127
-	log.Debugf("Untar time: %vs", time.Now().UTC().Sub(start).Seconds())
127
+	logrus.Debugf("Untar time: %vs", time.Now().UTC().Sub(start).Seconds())
128 128
 
129 129
 	return
130 130
 }
... ...
@@ -12,7 +12,7 @@ import (
12 12
 	"sync"
13 13
 	"syscall"
14 14
 
15
-	log "github.com/Sirupsen/logrus"
15
+	"github.com/Sirupsen/logrus"
16 16
 	"github.com/docker/docker/daemon/graphdriver"
17 17
 	"github.com/docker/docker/pkg/archive"
18 18
 	"github.com/docker/docker/pkg/chrootarchive"
... ...
@@ -113,13 +113,13 @@ func Init(home string, options []string) (graphdriver.Driver, error) {
113 113
 	// check if they are running over btrfs or aufs
114 114
 	switch fsMagic {
115 115
 	case graphdriver.FsMagicBtrfs:
116
-		log.Error("'overlay' is not supported over btrfs.")
116
+		logrus.Error("'overlay' is not supported over btrfs.")
117 117
 		return nil, graphdriver.ErrIncompatibleFS
118 118
 	case graphdriver.FsMagicAufs:
119
-		log.Error("'overlay' is not supported over aufs.")
119
+		logrus.Error("'overlay' is not supported over aufs.")
120 120
 		return nil, graphdriver.ErrIncompatibleFS
121 121
 	case graphdriver.FsMagicZfs:
122
-		log.Error("'overlay' is not supported over zfs.")
122
+		logrus.Error("'overlay' is not supported over zfs.")
123 123
 		return nil, graphdriver.ErrIncompatibleFS
124 124
 	}
125 125
 
... ...
@@ -153,7 +153,7 @@ func supportsOverlay() error {
153 153
 			return nil
154 154
 		}
155 155
 	}
156
-	log.Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
156
+	logrus.Error("'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.")
157 157
 	return graphdriver.ErrNotSupported
158 158
 }
159 159
 
... ...
@@ -317,7 +317,7 @@ func (d *Driver) Put(id string) error {
317 317
 
318 318
 	mount := d.active[id]
319 319
 	if mount == nil {
320
-		log.Debugf("Put on a non-mounted device %s", id)
320
+		logrus.Debugf("Put on a non-mounted device %s", id)
321 321
 		return nil
322 322
 	}
323 323
 
... ...
@@ -330,7 +330,7 @@ func (d *Driver) Put(id string) error {
330 330
 	if mount.mounted {
331 331
 		err := syscall.Unmount(mount.path, 0)
332 332
 		if err != nil {
333
-			log.Debugf("Failed to unmount %s overlay: %v", id, err)
333
+			logrus.Debugf("Failed to unmount %s overlay: %v", id, err)
334 334
 		}
335 335
 		return err
336 336
 	}
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"runtime"
6 6
 	"time"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/docker/autogen/dockerversion"
10 10
 	"github.com/docker/docker/engine"
11 11
 	"github.com/docker/docker/pkg/parsers/kernel"
... ...
@@ -33,7 +33,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) error {
33 33
 		operatingSystem = s
34 34
 	}
35 35
 	if inContainer, err := operatingsystem.IsContainerized(); err != nil {
36
-		log.Errorf("Could not determine if daemon is containerized: %v", err)
36
+		logrus.Errorf("Could not determine if daemon is containerized: %v", err)
37 37
 		operatingSystem += " (error determining if containerized)"
38 38
 	} else if inContainer {
39 39
 		operatingSystem += " (containerized)"
... ...
@@ -41,7 +41,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) error {
41 41
 
42 42
 	meminfo, err := system.ReadMemInfo()
43 43
 	if err != nil {
44
-		log.Errorf("Could not read system memory info: %v", err)
44
+		logrus.Errorf("Could not read system memory info: %v", err)
45 45
 	}
46 46
 
47 47
 	// if we still have the original dockerinit binary from before we copied it locally, let's return the path to that, since that's more intuitive (the copied path is trivial to derive by hand given VERSION)
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"strconv"
10 10
 	"sync"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/engine"
14 14
 	"github.com/docker/docker/pkg/jsonlog"
15 15
 	"github.com/docker/docker/pkg/tailfile"
... ...
@@ -50,31 +50,31 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) error {
50 50
 	cLog, err := container.ReadLog("json")
51 51
 	if err != nil && os.IsNotExist(err) {
52 52
 		// Legacy logs
53
-		log.Debugf("Old logs format")
53
+		logrus.Debugf("Old logs format")
54 54
 		if stdout {
55 55
 			cLog, err := container.ReadLog("stdout")
56 56
 			if err != nil {
57
-				log.Errorf("Error reading logs (stdout): %s", err)
57
+				logrus.Errorf("Error reading logs (stdout): %s", err)
58 58
 			} else if _, err := io.Copy(job.Stdout, cLog); err != nil {
59
-				log.Errorf("Error streaming logs (stdout): %s", err)
59
+				logrus.Errorf("Error streaming logs (stdout): %s", err)
60 60
 			}
61 61
 		}
62 62
 		if stderr {
63 63
 			cLog, err := container.ReadLog("stderr")
64 64
 			if err != nil {
65
-				log.Errorf("Error reading logs (stderr): %s", err)
65
+				logrus.Errorf("Error reading logs (stderr): %s", err)
66 66
 			} else if _, err := io.Copy(job.Stderr, cLog); err != nil {
67
-				log.Errorf("Error streaming logs (stderr): %s", err)
67
+				logrus.Errorf("Error streaming logs (stderr): %s", err)
68 68
 			}
69 69
 		}
70 70
 	} else if err != nil {
71
-		log.Errorf("Error reading logs (json): %s", err)
71
+		logrus.Errorf("Error reading logs (json): %s", err)
72 72
 	} else {
73 73
 		if tail != "all" {
74 74
 			var err error
75 75
 			lines, err = strconv.Atoi(tail)
76 76
 			if err != nil {
77
-				log.Errorf("Failed to parse tail %s, error: %v, show all logs", tail, err)
77
+				logrus.Errorf("Failed to parse tail %s, error: %v, show all logs", tail, err)
78 78
 				lines = -1
79 79
 			}
80 80
 		}
... ...
@@ -97,7 +97,7 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) error {
97 97
 				if err := dec.Decode(l); err == io.EOF {
98 98
 					break
99 99
 				} else if err != nil {
100
-					log.Errorf("Error streaming logs: %s", err)
100
+					logrus.Errorf("Error streaming logs: %s", err)
101 101
 					break
102 102
 				}
103 103
 				logLine := l.Log
... ...
@@ -143,7 +143,7 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) error {
143 143
 
144 144
 		for err := range errors {
145 145
 			if err != nil {
146
-				log.Errorf("%s", err)
146
+				logrus.Errorf("%s", err)
147 147
 			}
148 148
 		}
149 149
 
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"sync"
7 7
 	"time"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/daemon/execdriver"
11 11
 	"github.com/docker/docker/pkg/stringid"
12 12
 	"github.com/docker/docker/runconfig"
... ...
@@ -89,7 +89,7 @@ func (m *containerMonitor) Close() error {
89 89
 	// because they share same runconfig and change image. Must be fixed
90 90
 	// in builder/builder.go
91 91
 	if err := m.container.toDisk(); err != nil {
92
-		log.Errorf("Error dumping container %s state to disk: %s", m.container.ID, err)
92
+		logrus.Errorf("Error dumping container %s state to disk: %s", m.container.ID, err)
93 93
 
94 94
 		return err
95 95
 	}
... ...
@@ -145,7 +145,7 @@ func (m *containerMonitor) Start() error {
145 145
 				return err
146 146
 			}
147 147
 
148
-			log.Errorf("Error running container: %s", err)
148
+			logrus.Errorf("Error running container: %s", err)
149 149
 		}
150 150
 
151 151
 		// here container.Lock is already lost
... ...
@@ -229,7 +229,7 @@ func (m *containerMonitor) shouldRestart(exitCode int) bool {
229 229
 	case "on-failure":
230 230
 		// the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count
231 231
 		if max := m.restartPolicy.MaximumRetryCount; max != 0 && m.failureCount > max {
232
-			log.Debugf("stopping restart of container %s because maximum failure could of %d has been reached",
232
+			logrus.Debugf("stopping restart of container %s because maximum failure could of %d has been reached",
233 233
 				stringid.TruncateID(m.container.ID), max)
234 234
 			return false
235 235
 		}
... ...
@@ -263,7 +263,7 @@ func (m *containerMonitor) callback(processConfig *execdriver.ProcessConfig, pid
263 263
 	}
264 264
 
265 265
 	if err := m.container.ToDisk(); err != nil {
266
-		log.Debugf("%s", err)
266
+		logrus.Debugf("%s", err)
267 267
 	}
268 268
 }
269 269
 
... ...
@@ -279,21 +279,21 @@ func (m *containerMonitor) resetContainer(lock bool) {
279 279
 
280 280
 	if container.Config.OpenStdin {
281 281
 		if err := container.stdin.Close(); err != nil {
282
-			log.Errorf("%s: Error close stdin: %s", container.ID, err)
282
+			logrus.Errorf("%s: Error close stdin: %s", container.ID, err)
283 283
 		}
284 284
 	}
285 285
 
286 286
 	if err := container.stdout.Clean(); err != nil {
287
-		log.Errorf("%s: Error close stdout: %s", container.ID, err)
287
+		logrus.Errorf("%s: Error close stdout: %s", container.ID, err)
288 288
 	}
289 289
 
290 290
 	if err := container.stderr.Clean(); err != nil {
291
-		log.Errorf("%s: Error close stderr: %s", container.ID, err)
291
+		logrus.Errorf("%s: Error close stderr: %s", container.ID, err)
292 292
 	}
293 293
 
294 294
 	if container.command != nil && container.command.ProcessConfig.Terminal != nil {
295 295
 		if err := container.command.ProcessConfig.Terminal.Close(); err != nil {
296
-			log.Errorf("%s: Error closing terminal: %s", container.ID, err)
296
+			logrus.Errorf("%s: Error closing terminal: %s", container.ID, err)
297 297
 		}
298 298
 	}
299 299
 
... ...
@@ -311,7 +311,7 @@ func (m *containerMonitor) resetContainer(lock bool) {
311 311
 			}()
312 312
 			select {
313 313
 			case <-time.After(1 * time.Second):
314
-				log.Warnf("Logger didn't exit in time: logs may be truncated")
314
+				logrus.Warnf("Logger didn't exit in time: logs may be truncated")
315 315
 			case <-exit:
316 316
 			}
317 317
 		}
... ...
@@ -10,7 +10,7 @@ import (
10 10
 	"strings"
11 11
 	"sync"
12 12
 
13
-	log "github.com/Sirupsen/logrus"
13
+	"github.com/Sirupsen/logrus"
14 14
 	"github.com/docker/docker/daemon/networkdriver"
15 15
 	"github.com/docker/docker/daemon/networkdriver/ipallocator"
16 16
 	"github.com/docker/docker/daemon/networkdriver/portmapper"
... ...
@@ -132,9 +132,9 @@ func InitDriver(job *engine.Job) error {
132 132
 
133 133
 		if fixedCIDRv6 != "" {
134 134
 			// Setting route to global IPv6 subnet
135
-			log.Infof("Adding route to IPv6 network %q via device %q", fixedCIDRv6, bridgeIface)
135
+			logrus.Infof("Adding route to IPv6 network %q via device %q", fixedCIDRv6, bridgeIface)
136 136
 			if err := netlink.AddRoute(fixedCIDRv6, "", "", bridgeIface); err != nil {
137
-				log.Fatalf("Could not add route to IPv6 network %q via device %q", fixedCIDRv6, bridgeIface)
137
+				logrus.Fatalf("Could not add route to IPv6 network %q via device %q", fixedCIDRv6, bridgeIface)
138 138
 			}
139 139
 		}
140 140
 	} else {
... ...
@@ -207,16 +207,16 @@ func InitDriver(job *engine.Job) error {
207 207
 	if ipForward {
208 208
 		// Enable IPv4 forwarding
209 209
 		if err := ioutil.WriteFile("/proc/sys/net/ipv4/ip_forward", []byte{'1', '\n'}, 0644); err != nil {
210
-			log.Warnf("WARNING: unable to enable IPv4 forwarding: %s\n", err)
210
+			logrus.Warnf("WARNING: unable to enable IPv4 forwarding: %s\n", err)
211 211
 		}
212 212
 
213 213
 		if fixedCIDRv6 != "" {
214 214
 			// Enable IPv6 forwarding
215 215
 			if err := ioutil.WriteFile("/proc/sys/net/ipv6/conf/default/forwarding", []byte{'1', '\n'}, 0644); err != nil {
216
-				log.Warnf("WARNING: unable to enable IPv6 default forwarding: %s\n", err)
216
+				logrus.Warnf("WARNING: unable to enable IPv6 default forwarding: %s\n", err)
217 217
 			}
218 218
 			if err := ioutil.WriteFile("/proc/sys/net/ipv6/conf/all/forwarding", []byte{'1', '\n'}, 0644); err != nil {
219
-				log.Warnf("WARNING: unable to enable IPv6 all forwarding: %s\n", err)
219
+				logrus.Warnf("WARNING: unable to enable IPv6 all forwarding: %s\n", err)
220 220
 			}
221 221
 		}
222 222
 	}
... ...
@@ -244,7 +244,7 @@ func InitDriver(job *engine.Job) error {
244 244
 		if err != nil {
245 245
 			return err
246 246
 		}
247
-		log.Debugf("Subnet: %v", subnet)
247
+		logrus.Debugf("Subnet: %v", subnet)
248 248
 		if err := ipAllocator.RegisterSubnet(bridgeIPv4Network, subnet); err != nil {
249 249
 			return err
250 250
 		}
... ...
@@ -255,7 +255,7 @@ func InitDriver(job *engine.Job) error {
255 255
 		if err != nil {
256 256
 			return err
257 257
 		}
258
-		log.Debugf("Subnet: %v", subnet)
258
+		logrus.Debugf("Subnet: %v", subnet)
259 259
 		if err := ipAllocator.RegisterSubnet(subnet, subnet); err != nil {
260 260
 			return err
261 261
 		}
... ...
@@ -307,7 +307,7 @@ func setupIPTables(addr net.Addr, icc, ipmasq bool) error {
307 307
 		iptables.Raw(append([]string{"-D", "FORWARD"}, acceptArgs...)...)
308 308
 
309 309
 		if !iptables.Exists(iptables.Filter, "FORWARD", dropArgs...) {
310
-			log.Debugf("Disable inter-container communication")
310
+			logrus.Debugf("Disable inter-container communication")
311 311
 			if output, err := iptables.Raw(append([]string{"-I", "FORWARD"}, dropArgs...)...); err != nil {
312 312
 				return fmt.Errorf("Unable to prevent intercontainer communication: %s", err)
313 313
 			} else if len(output) != 0 {
... ...
@@ -318,7 +318,7 @@ func setupIPTables(addr net.Addr, icc, ipmasq bool) error {
318 318
 		iptables.Raw(append([]string{"-D", "FORWARD"}, dropArgs...)...)
319 319
 
320 320
 		if !iptables.Exists(iptables.Filter, "FORWARD", acceptArgs...) {
321
-			log.Debugf("Enable inter-container communication")
321
+			logrus.Debugf("Enable inter-container communication")
322 322
 			if output, err := iptables.Raw(append([]string{"-I", "FORWARD"}, acceptArgs...)...); err != nil {
323 323
 				return fmt.Errorf("Unable to allow intercontainer communication: %s", err)
324 324
 			} else if len(output) != 0 {
... ...
@@ -384,7 +384,7 @@ func configureBridge(bridgeIP string, bridgeIPv6 string, enableIPv6 bool) error
384 384
 					ifaceAddr = addr
385 385
 					break
386 386
 				} else {
387
-					log.Debugf("%s %s", addr, err)
387
+					logrus.Debugf("%s %s", addr, err)
388 388
 				}
389 389
 			}
390 390
 		}
... ...
@@ -393,7 +393,7 @@ func configureBridge(bridgeIP string, bridgeIPv6 string, enableIPv6 bool) error
393 393
 	if ifaceAddr == "" {
394 394
 		return fmt.Errorf("Could not find a free IP address range for interface '%s'. Please configure its address manually and run 'docker -b %s'", bridgeIface, bridgeIface)
395 395
 	}
396
-	log.Debugf("Creating bridge %s with network %s", bridgeIface, ifaceAddr)
396
+	logrus.Debugf("Creating bridge %s with network %s", bridgeIface, ifaceAddr)
397 397
 
398 398
 	if err := createBridgeIface(bridgeIface); err != nil {
399 399
 		// The bridge may already exist, therefore we can ignore an "exists" error
... ...
@@ -457,7 +457,7 @@ func createBridgeIface(name string) error {
457 457
 	// Only set the bridge's mac address if the kernel version is > 3.3
458 458
 	// before that it was not supported
459 459
 	setBridgeMacAddr := err == nil && (kv.Kernel >= 3 && kv.Major >= 3)
460
-	log.Debugf("setting bridge mac address = %v", setBridgeMacAddr)
460
+	logrus.Debugf("setting bridge mac address = %v", setBridgeMacAddr)
461 461
 	return netlink.CreateBridge(name, setBridgeMacAddr)
462 462
 }
463 463
 
... ...
@@ -533,10 +533,10 @@ func Allocate(job *engine.Job) error {
533 533
 
534 534
 		globalIPv6, err = ipAllocator.RequestIP(globalIPv6Network, requestedIPv6)
535 535
 		if err != nil {
536
-			log.Errorf("Allocator: RequestIP v6: %v", err)
536
+			logrus.Errorf("Allocator: RequestIP v6: %v", err)
537 537
 			return err
538 538
 		}
539
-		log.Infof("Allocated IPv6 %s", globalIPv6)
539
+		logrus.Infof("Allocated IPv6 %s", globalIPv6)
540 540
 	}
541 541
 
542 542
 	out := engine.Env{}
... ...
@@ -588,16 +588,16 @@ func Release(job *engine.Job) error {
588 588
 
589 589
 	for _, nat := range containerInterface.PortMappings {
590 590
 		if err := portmapper.Unmap(nat); err != nil {
591
-			log.Infof("Unable to unmap port %s: %s", nat, err)
591
+			logrus.Infof("Unable to unmap port %s: %s", nat, err)
592 592
 		}
593 593
 	}
594 594
 
595 595
 	if err := ipAllocator.ReleaseIP(bridgeIPv4Network, containerInterface.IP); err != nil {
596
-		log.Infof("Unable to release IPv4 %s", err)
596
+		logrus.Infof("Unable to release IPv4 %s", err)
597 597
 	}
598 598
 	if globalIPv6Network != nil {
599 599
 		if err := ipAllocator.ReleaseIP(globalIPv6Network, containerInterface.IPv6); err != nil {
600
-			log.Infof("Unable to release IPv6 %s", err)
600
+			logrus.Infof("Unable to release IPv6 %s", err)
601 601
 		}
602 602
 	}
603 603
 	return nil
... ...
@@ -650,10 +650,10 @@ func AllocatePort(job *engine.Job) error {
650 650
 		// There is no point in immediately retrying to map an explicitly
651 651
 		// chosen port.
652 652
 		if hostPort != 0 {
653
-			log.Warnf("Failed to allocate and map port %d: %s", hostPort, err)
653
+			logrus.Warnf("Failed to allocate and map port %d: %s", hostPort, err)
654 654
 			break
655 655
 		}
656
-		log.Warnf("Failed to allocate and map port: %s, retry: %d", err, i+1)
656
+		logrus.Warnf("Failed to allocate and map port: %s, retry: %d", err, i+1)
657 657
 	}
658 658
 
659 659
 	if err != nil {
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"net"
7 7
 	"sync"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/daemon/networkdriver"
11 11
 )
12 12
 
... ...
@@ -157,7 +157,7 @@ func ipToBigInt(ip net.IP) *big.Int {
157 157
 		return x.SetBytes(ip6)
158 158
 	}
159 159
 
160
-	log.Errorf("ipToBigInt: Wrong IP length! %s", ip)
160
+	logrus.Errorf("ipToBigInt: Wrong IP length! %s", ip)
161 161
 	return nil
162 162
 }
163 163
 
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"os"
9 9
 	"sync"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 )
13 13
 
14 14
 const (
... ...
@@ -87,7 +87,7 @@ func init() {
87 87
 
88 88
 	file, err := os.Open(portRangeKernelParam)
89 89
 	if err != nil {
90
-		log.Warnf("port allocator - %s due to error: %v", portRangeFallback, err)
90
+		logrus.Warnf("port allocator - %s due to error: %v", portRangeFallback, err)
91 91
 		return
92 92
 	}
93 93
 	var start, end int
... ...
@@ -96,7 +96,7 @@ func init() {
96 96
 		if err == nil {
97 97
 			err = fmt.Errorf("unexpected count of parsed numbers (%d)", n)
98 98
 		}
99
-		log.Errorf("port allocator - failed to parse system ephemeral port range from %s - %s: %v", portRangeKernelParam, portRangeFallback, err)
99
+		logrus.Errorf("port allocator - failed to parse system ephemeral port range from %s - %s: %v", portRangeKernelParam, portRangeFallback, err)
100 100
 		return
101 101
 	}
102 102
 	beginPortRange = start
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"net"
7 7
 	"sync"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/daemon/networkdriver/portallocator"
11 11
 	"github.com/docker/docker/pkg/iptables"
12 12
 )
... ...
@@ -156,7 +156,7 @@ func (pm *PortMapper) Unmap(host net.Addr) error {
156 156
 	containerIP, containerPort := getIPAndPort(data.container)
157 157
 	hostIP, hostPort := getIPAndPort(data.host)
158 158
 	if err := pm.forward(iptables.Delete, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
159
-		log.Errorf("Error on iptables delete: %s", err)
159
+		logrus.Errorf("Error on iptables delete: %s", err)
160 160
 	}
161 161
 
162 162
 	switch a := host.(type) {
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"sync"
10 10
 	"time"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/daemon/execdriver"
14 14
 	"github.com/docker/docker/pkg/pubsub"
15 15
 	"github.com/docker/libcontainer/system"
... ...
@@ -80,13 +80,13 @@ func (s *statsCollector) run() {
80 80
 		for container, publisher := range s.publishers {
81 81
 			systemUsage, err := s.getSystemCpuUsage()
82 82
 			if err != nil {
83
-				log.Errorf("collecting system cpu usage for %s: %v", container.ID, err)
83
+				logrus.Errorf("collecting system cpu usage for %s: %v", container.ID, err)
84 84
 				continue
85 85
 			}
86 86
 			stats, err := container.Stats()
87 87
 			if err != nil {
88 88
 				if err != execdriver.ErrNotRunning {
89
-					log.Errorf("collecting stats for %s: %v", container.ID, err)
89
+					logrus.Errorf("collecting stats for %s: %v", container.ID, err)
90 90
 				}
91 91
 				continue
92 92
 			}
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"sort"
10 10
 	"strings"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/daemon/execdriver"
14 14
 	"github.com/docker/docker/pkg/chrootarchive"
15 15
 	"github.com/docker/docker/pkg/symlink"
... ...
@@ -133,7 +133,7 @@ func (container *Container) registerVolumes() {
133 133
 		}
134 134
 		v, err := container.daemon.volumes.FindOrCreateVolume(path, writable)
135 135
 		if err != nil {
136
-			log.Debugf("error registering volume %s: %v", path, err)
136
+			logrus.Debugf("error registering volume %s: %v", path, err)
137 137
 			continue
138 138
 		}
139 139
 		v.AddContainer(container.ID)
... ...
@@ -144,7 +144,7 @@ func (container *Container) derefVolumes() {
144 144
 	for path := range container.VolumePaths() {
145 145
 		vol := container.daemon.volumes.Get(path)
146 146
 		if vol == nil {
147
-			log.Debugf("Volume %s was not found and could not be dereferenced", path)
147
+			logrus.Debugf("Volume %s was not found and could not be dereferenced", path)
148 148
 			continue
149 149
 		}
150 150
 		vol.RemoveContainer(container.ID)
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"path/filepath"
10 10
 	"strings"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/autogen/dockerversion"
14 14
 	"github.com/docker/docker/builder"
15 15
 	"github.com/docker/docker/builtins"
... ...
@@ -46,7 +46,7 @@ func migrateKey() (err error) {
46 46
 			if err == nil {
47 47
 				err = os.Remove(oldPath)
48 48
 			} else {
49
-				log.Warnf("Key migration failed, key file not removed at %s", oldPath)
49
+				logrus.Warnf("Key migration failed, key file not removed at %s", oldPath)
50 50
 			}
51 51
 		}()
52 52
 
... ...
@@ -70,7 +70,7 @@ func migrateKey() (err error) {
70 70
 			return fmt.Errorf("error copying key: %s", err)
71 71
 		}
72 72
 
73
-		log.Infof("Migrated key from %s to %s", oldPath, newPath)
73
+		logrus.Infof("Migrated key from %s to %s", oldPath, newPath)
74 74
 	}
75 75
 
76 76
 	return nil
... ...
@@ -85,18 +85,18 @@ func mainDaemon() {
85 85
 	signal.Trap(eng.Shutdown)
86 86
 
87 87
 	if err := migrateKey(); err != nil {
88
-		log.Fatal(err)
88
+		logrus.Fatal(err)
89 89
 	}
90 90
 	daemonCfg.TrustKeyPath = *flTrustKey
91 91
 
92 92
 	// Load builtins
93 93
 	if err := builtins.Register(eng); err != nil {
94
-		log.Fatal(err)
94
+		logrus.Fatal(err)
95 95
 	}
96 96
 
97 97
 	// load registry service
98 98
 	if err := registry.NewService(registryCfg).Install(eng); err != nil {
99
-		log.Fatal(err)
99
+		logrus.Fatal(err)
100 100
 	}
101 101
 
102 102
 	// load the daemon in the background so we can immediately start
... ...
@@ -110,7 +110,7 @@ func mainDaemon() {
110 110
 			return
111 111
 		}
112 112
 
113
-		log.Infof("docker daemon: %s %s; execdriver: %s; graphdriver: %s",
113
+		logrus.Infof("docker daemon: %s %s; execdriver: %s; graphdriver: %s",
114 114
 			dockerversion.VERSION,
115 115
 			dockerversion.GITCOMMIT,
116 116
 			d.ExecutionDriver().Name(),
... ...
@@ -155,7 +155,7 @@ func mainDaemon() {
155 155
 	serveAPIWait := make(chan error)
156 156
 	go func() {
157 157
 		if err := job.Run(); err != nil {
158
-			log.Errorf("ServeAPI error: %v", err)
158
+			logrus.Errorf("ServeAPI error: %v", err)
159 159
 			serveAPIWait <- err
160 160
 			return
161 161
 		}
... ...
@@ -164,7 +164,7 @@ func mainDaemon() {
164 164
 
165 165
 	// Wait for the daemon startup goroutine to finish
166 166
 	// This makes sure we can actually cleanly shutdown the daemon
167
-	log.Debug("waiting for daemon to initialize")
167
+	logrus.Debug("waiting for daemon to initialize")
168 168
 	errDaemon := <-daemonInitWait
169 169
 	if errDaemon != nil {
170 170
 		eng.Shutdown()
... ...
@@ -176,9 +176,9 @@ func mainDaemon() {
176 176
 		}
177 177
 		// we must "fatal" exit here as the API server may be happy to
178 178
 		// continue listening forever if the error had no impact to API
179
-		log.Fatal(outStr)
179
+		logrus.Fatal(outStr)
180 180
 	} else {
181
-		log.Info("Daemon has completed initialization")
181
+		logrus.Info("Daemon has completed initialization")
182 182
 	}
183 183
 
184 184
 	// Daemon is fully initialized and handling API traffic
... ...
@@ -188,7 +188,7 @@ func mainDaemon() {
188 188
 	// exited the daemon process above)
189 189
 	eng.Shutdown()
190 190
 	if errAPI != nil {
191
-		log.Fatalf("Shutting down due to ServeAPI error: %v", errAPI)
191
+		logrus.Fatalf("Shutting down due to ServeAPI error: %v", errAPI)
192 192
 	}
193 193
 
194 194
 }
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"os"
9 9
 	"strings"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/api"
13 13
 	"github.com/docker/docker/api/client"
14 14
 	"github.com/docker/docker/autogen/dockerversion"
... ...
@@ -44,20 +44,20 @@ func main() {
44 44
 	}
45 45
 
46 46
 	if *flLogLevel != "" {
47
-		lvl, err := log.ParseLevel(*flLogLevel)
47
+		lvl, err := logrus.ParseLevel(*flLogLevel)
48 48
 		if err != nil {
49
-			log.Fatalf("Unable to parse logging level: %s", *flLogLevel)
49
+			logrus.Fatalf("Unable to parse logging level: %s", *flLogLevel)
50 50
 		}
51 51
 		setLogLevel(lvl)
52 52
 	} else {
53
-		setLogLevel(log.InfoLevel)
53
+		setLogLevel(logrus.InfoLevel)
54 54
 	}
55 55
 
56 56
 	// -D, --debug, -l/--log-level=debug processing
57 57
 	// When/if -D is removed this block can be deleted
58 58
 	if *flDebug {
59 59
 		os.Setenv("DEBUG", "1")
60
-		setLogLevel(log.DebugLevel)
60
+		setLogLevel(logrus.DebugLevel)
61 61
 	}
62 62
 
63 63
 	if len(flHosts) == 0 {
... ...
@@ -68,7 +68,7 @@ func main() {
68 68
 		}
69 69
 		defaultHost, err := api.ValidateHost(defaultHost)
70 70
 		if err != nil {
71
-			log.Fatal(err)
71
+			logrus.Fatal(err)
72 72
 		}
73 73
 		flHosts = append(flHosts, defaultHost)
74 74
 	}
... ...
@@ -85,7 +85,7 @@ func main() {
85 85
 	}
86 86
 
87 87
 	if len(flHosts) > 1 {
88
-		log.Fatal("Please specify only one -H")
88
+		logrus.Fatal("Please specify only one -H")
89 89
 	}
90 90
 	protoAddrParts := strings.SplitN(flHosts[0], "://", 2)
91 91
 
... ...
@@ -106,7 +106,7 @@ func main() {
106 106
 		certPool := x509.NewCertPool()
107 107
 		file, err := ioutil.ReadFile(*flCa)
108 108
 		if err != nil {
109
-			log.Fatalf("Couldn't read ca cert %s: %s", *flCa, err)
109
+			logrus.Fatalf("Couldn't read ca cert %s: %s", *flCa, err)
110 110
 		}
111 111
 		certPool.AppendCertsFromPEM(file)
112 112
 		tlsConfig.RootCAs = certPool
... ...
@@ -121,7 +121,7 @@ func main() {
121 121
 			*flTls = true
122 122
 			cert, err := tls.LoadX509KeyPair(*flCert, *flKey)
123 123
 			if err != nil {
124
-				log.Fatalf("Couldn't load X509 key pair: %q. Make sure the key is encrypted", err)
124
+				logrus.Fatalf("Couldn't load X509 key pair: %q. Make sure the key is encrypted", err)
125 125
 			}
126 126
 			tlsConfig.Certificates = []tls.Certificate{cert}
127 127
 		}
... ...
@@ -138,11 +138,11 @@ func main() {
138 138
 	if err := cli.Cmd(flag.Args()...); err != nil {
139 139
 		if sterr, ok := err.(*utils.StatusError); ok {
140 140
 			if sterr.Status != "" {
141
-				log.Println(sterr.Status)
141
+				logrus.Println(sterr.Status)
142 142
 			}
143 143
 			os.Exit(sterr.StatusCode)
144 144
 		}
145
-		log.Fatal(err)
145
+		logrus.Fatal(err)
146 146
 	}
147 147
 }
148 148
 
... ...
@@ -1,14 +1,14 @@
1 1
 package main
2 2
 
3 3
 import (
4
-	log "github.com/Sirupsen/logrus"
4
+	"github.com/Sirupsen/logrus"
5 5
 	"io"
6 6
 )
7 7
 
8
-func setLogLevel(lvl log.Level) {
9
-	log.SetLevel(lvl)
8
+func setLogLevel(lvl logrus.Level) {
9
+	logrus.SetLevel(lvl)
10 10
 }
11 11
 
12 12
 func initLogging(stderr io.Writer) {
13
-	log.SetOutput(stderr)
13
+	logrus.SetOutput(stderr)
14 14
 }
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"sync"
9 9
 	"time"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 )
13 13
 
14 14
 // A job is the fundamental unit of work in the docker engine.
... ...
@@ -67,10 +67,10 @@ func (job *Job) Run() error {
67 67
 	}
68 68
 	// Log beginning and end of the job
69 69
 	if job.Eng.Logging {
70
-		log.Infof("+job %s", job.CallString())
70
+		logrus.Infof("+job %s", job.CallString())
71 71
 		defer func() {
72 72
 			// what if err is nil?
73
-			log.Infof("-job %s%s", job.CallString(), job.err)
73
+			logrus.Infof("-job %s%s", job.CallString(), job.err)
74 74
 		}()
75 75
 	}
76 76
 	var errorMessage = bytes.NewBuffer(nil)
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"os"
9 9
 	"path"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/engine"
13 13
 	"github.com/docker/docker/pkg/archive"
14 14
 	"github.com/docker/docker/pkg/parsers"
... ...
@@ -33,7 +33,7 @@ func (s *TagStore) CmdImageExport(job *engine.Job) error {
33 33
 
34 34
 	rootRepoMap := map[string]Repository{}
35 35
 	addKey := func(name string, tag string, id string) {
36
-		log.Debugf("add key [%s:%s]", name, tag)
36
+		logrus.Debugf("add key [%s:%s]", name, tag)
37 37
 		if repo, ok := rootRepoMap[name]; !ok {
38 38
 			rootRepoMap[name] = Repository{tag: id}
39 39
 		} else {
... ...
@@ -42,7 +42,7 @@ func (s *TagStore) CmdImageExport(job *engine.Job) error {
42 42
 	}
43 43
 	for _, name := range job.Args {
44 44
 		name = registry.NormalizeLocalName(name)
45
-		log.Debugf("Serializing %s", name)
45
+		logrus.Debugf("Serializing %s", name)
46 46
 		rootRepo := s.Repositories[name]
47 47
 		if rootRepo != nil {
48 48
 			// this is a base repo name, like 'busybox'
... ...
@@ -78,7 +78,7 @@ func (s *TagStore) CmdImageExport(job *engine.Job) error {
78 78
 				}
79 79
 			}
80 80
 		}
81
-		log.Debugf("End Serializing %s", name)
81
+		logrus.Debugf("End Serializing %s", name)
82 82
 	}
83 83
 	// write repositories, if there is something to write
84 84
 	if len(rootRepoMap) > 0 {
... ...
@@ -87,7 +87,7 @@ func (s *TagStore) CmdImageExport(job *engine.Job) error {
87 87
 			return err
88 88
 		}
89 89
 	} else {
90
-		log.Debugf("There were no repositories to write")
90
+		logrus.Debugf("There were no repositories to write")
91 91
 	}
92 92
 
93 93
 	fs, err := archive.Tar(tempdir, archive.Uncompressed)
... ...
@@ -99,7 +99,7 @@ func (s *TagStore) CmdImageExport(job *engine.Job) error {
99 99
 	if _, err := io.Copy(job.Stdout, fs); err != nil {
100 100
 		return err
101 101
 	}
102
-	log.Debugf("End export job: %s", job.Name)
102
+	logrus.Debugf("End export job: %s", job.Name)
103 103
 	return nil
104 104
 }
105 105
 
... ...
@@ -12,7 +12,7 @@ import (
12 12
 	"syscall"
13 13
 	"time"
14 14
 
15
-	log "github.com/Sirupsen/logrus"
15
+	"github.com/Sirupsen/logrus"
16 16
 	"github.com/docker/docker/autogen/dockerversion"
17 17
 	"github.com/docker/docker/daemon/graphdriver"
18 18
 	"github.com/docker/docker/image"
... ...
@@ -68,7 +68,7 @@ func (graph *Graph) restore() error {
68 68
 		}
69 69
 	}
70 70
 	graph.idIndex = truncindex.NewTruncIndex(ids)
71
-	log.Debugf("Restored %d elements", len(dir))
71
+	logrus.Debugf("Restored %d elements", len(dir))
72 72
 	return nil
73 73
 }
74 74
 
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"net/http"
8 8
 	"net/url"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 	"github.com/docker/docker/engine"
12 12
 	"github.com/docker/docker/pkg/archive"
13 13
 	"github.com/docker/docker/pkg/progressreader"
... ...
@@ -93,7 +93,7 @@ func (s *TagStore) CmdImport(job *engine.Job) error {
93 93
 		logID = utils.ImageReference(logID, tag)
94 94
 	}
95 95
 	if err = job.Eng.Job("log", "import", logID, "").Run(); err != nil {
96
-		log.Errorf("Error logging event 'import' for %s: %s", logID, err)
96
+		logrus.Errorf("Error logging event 'import' for %s: %s", logID, err)
97 97
 	}
98 98
 	return nil
99 99
 }
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"os"
9 9
 	"path"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/engine"
13 13
 	"github.com/docker/docker/image"
14 14
 	"github.com/docker/docker/pkg/archive"
... ...
@@ -82,33 +82,33 @@ func (s *TagStore) CmdLoad(job *engine.Job) error {
82 82
 
83 83
 func (s *TagStore) recursiveLoad(eng *engine.Engine, address, tmpImageDir string) error {
84 84
 	if err := eng.Job("image_get", address).Run(); err != nil {
85
-		log.Debugf("Loading %s", address)
85
+		logrus.Debugf("Loading %s", address)
86 86
 
87 87
 		imageJson, err := ioutil.ReadFile(path.Join(tmpImageDir, "repo", address, "json"))
88 88
 		if err != nil {
89
-			log.Debugf("Error reading json", err)
89
+			logrus.Debugf("Error reading json", err)
90 90
 			return err
91 91
 		}
92 92
 
93 93
 		layer, err := os.Open(path.Join(tmpImageDir, "repo", address, "layer.tar"))
94 94
 		if err != nil {
95
-			log.Debugf("Error reading embedded tar", err)
95
+			logrus.Debugf("Error reading embedded tar", err)
96 96
 			return err
97 97
 		}
98 98
 		img, err := image.NewImgJSON(imageJson)
99 99
 		if err != nil {
100
-			log.Debugf("Error unmarshalling json", err)
100
+			logrus.Debugf("Error unmarshalling json", err)
101 101
 			return err
102 102
 		}
103 103
 		if err := utils.ValidateID(img.ID); err != nil {
104
-			log.Debugf("Error validating ID: %s", err)
104
+			logrus.Debugf("Error validating ID: %s", err)
105 105
 			return err
106 106
 		}
107 107
 
108 108
 		// ensure no two downloads of the same layer happen at the same time
109 109
 		if c, err := s.poolAdd("pull", "layer:"+img.ID); err != nil {
110 110
 			if c != nil {
111
-				log.Debugf("Image (id: %s) load is already running, waiting: %v", img.ID, err)
111
+				logrus.Debugf("Image (id: %s) load is already running, waiting: %v", img.ID, err)
112 112
 				<-c
113 113
 				return nil
114 114
 			}
... ...
@@ -129,7 +129,7 @@ func (s *TagStore) recursiveLoad(eng *engine.Engine, address, tmpImageDir string
129 129
 			return err
130 130
 		}
131 131
 	}
132
-	log.Debugf("Completed processing %s", address)
132
+	logrus.Debugf("Completed processing %s", address)
133 133
 
134 134
 	return nil
135 135
 }
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"encoding/json"
6 6
 	"fmt"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/distribution/digest"
10 10
 	"github.com/docker/docker/engine"
11 11
 	"github.com/docker/docker/registry"
... ...
@@ -89,7 +89,7 @@ func (s *TagStore) loadManifest(eng *engine.Engine, manifestBytes []byte, dgst,
89 89
 			return nil, false, fmt.Errorf("error running key check: %s", err)
90 90
 		}
91 91
 		result := engine.Tail(stdoutBuffer, 1)
92
-		log.Debugf("Key check result: %q", result)
92
+		logrus.Debugf("Key check result: %q", result)
93 93
 		if result == "verified" {
94 94
 			verified = true
95 95
 		}
... ...
@@ -10,7 +10,7 @@ import (
10 10
 	"strings"
11 11
 	"time"
12 12
 
13
-	log "github.com/Sirupsen/logrus"
13
+	"github.com/Sirupsen/logrus"
14 14
 	"github.com/docker/distribution/digest"
15 15
 	"github.com/docker/docker/engine"
16 16
 	"github.com/docker/docker/image"
... ...
@@ -59,7 +59,7 @@ func (s *TagStore) CmdPull(job *engine.Job) error {
59 59
 	}
60 60
 	defer s.poolRemove("pull", utils.ImageReference(repoInfo.LocalName, tag))
61 61
 
62
-	log.Debugf("pulling image from host %q with remote name %q", repoInfo.Index.Name, repoInfo.RemoteName)
62
+	logrus.Debugf("pulling image from host %q with remote name %q", repoInfo.Index.Name, repoInfo.RemoteName)
63 63
 	endpoint, err := repoInfo.GetEndpoint()
64 64
 	if err != nil {
65 65
 		return err
... ...
@@ -79,30 +79,30 @@ func (s *TagStore) CmdPull(job *engine.Job) error {
79 79
 		if repoInfo.Official {
80 80
 			j := job.Eng.Job("trust_update_base")
81 81
 			if err = j.Run(); err != nil {
82
-				log.Errorf("error updating trust base graph: %s", err)
82
+				logrus.Errorf("error updating trust base graph: %s", err)
83 83
 			}
84 84
 		}
85 85
 
86
-		log.Debugf("pulling v2 repository with local name %q", repoInfo.LocalName)
86
+		logrus.Debugf("pulling v2 repository with local name %q", repoInfo.LocalName)
87 87
 		if err := s.pullV2Repository(job.Eng, r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel")); err == nil {
88 88
 			if err = job.Eng.Job("log", "pull", logName, "").Run(); err != nil {
89
-				log.Errorf("Error logging event 'pull' for %s: %s", logName, err)
89
+				logrus.Errorf("Error logging event 'pull' for %s: %s", logName, err)
90 90
 			}
91 91
 			return nil
92 92
 		} else if err != registry.ErrDoesNotExist && err != ErrV2RegistryUnavailable {
93
-			log.Errorf("Error from V2 registry: %s", err)
93
+			logrus.Errorf("Error from V2 registry: %s", err)
94 94
 		}
95 95
 
96
-		log.Debug("image does not exist on v2 registry, falling back to v1")
96
+		logrus.Debug("image does not exist on v2 registry, falling back to v1")
97 97
 	}
98 98
 
99
-	log.Debugf("pulling v1 repository with local name %q", repoInfo.LocalName)
99
+	logrus.Debugf("pulling v1 repository with local name %q", repoInfo.LocalName)
100 100
 	if err = s.pullRepository(r, job.Stdout, repoInfo, tag, sf, job.GetenvBool("parallel")); err != nil {
101 101
 		return err
102 102
 	}
103 103
 
104 104
 	if err = job.Eng.Job("log", "pull", logName, "").Run(); err != nil {
105
-		log.Errorf("Error logging event 'pull' for %s: %s", logName, err)
105
+		logrus.Errorf("Error logging event 'pull' for %s: %s", logName, err)
106 106
 	}
107 107
 
108 108
 	return nil
... ...
@@ -120,10 +120,10 @@ func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, repoInfo *
120 120
 		return err
121 121
 	}
122 122
 
123
-	log.Debugf("Retrieving the tag list")
123
+	logrus.Debugf("Retrieving the tag list")
124 124
 	tagsList, err := r.GetRemoteTags(repoData.Endpoints, repoInfo.RemoteName, repoData.Tokens)
125 125
 	if err != nil {
126
-		log.Errorf("unable to get remote tags: %s", err)
126
+		logrus.Errorf("unable to get remote tags: %s", err)
127 127
 		return err
128 128
 	}
129 129
 
... ...
@@ -135,7 +135,7 @@ func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, repoInfo *
135 135
 		}
136 136
 	}
137 137
 
138
-	log.Debugf("Registering tags")
138
+	logrus.Debugf("Registering tags")
139 139
 	// If no tag has been specified, pull them all
140 140
 	if askedTag == "" {
141 141
 		for tag, id := range tagsList {
... ...
@@ -163,7 +163,7 @@ func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, repoInfo *
163 163
 			}
164 164
 
165 165
 			if img.Tag == "" {
166
-				log.Debugf("Image (id: %s) present in this repository but untagged, skipping", img.ID)
166
+				logrus.Debugf("Image (id: %s) present in this repository but untagged, skipping", img.ID)
167 167
 				if parallel {
168 168
 					errors <- nil
169 169
 				}
... ...
@@ -177,7 +177,7 @@ func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, repoInfo *
177 177
 					<-c
178 178
 					out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), "Download complete", nil))
179 179
 				} else {
180
-					log.Debugf("Image (id: %s) pull is already running, skipping: %v", img.ID, err)
180
+					logrus.Debugf("Image (id: %s) pull is already running, skipping: %v", img.ID, err)
181 181
 				}
182 182
 				if parallel {
183 183
 					errors <- nil
... ...
@@ -194,7 +194,7 @@ func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, repoInfo *
194 194
 				out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), fmt.Sprintf("Pulling image (%s) from %s, mirror: %s", img.Tag, repoInfo.CanonicalName, ep), nil))
195 195
 				if is_downloaded, err = s.pullImage(r, out, img.ID, ep, repoData.Tokens, sf); err != nil {
196 196
 					// Don't report errors when pulling from mirrors.
197
-					log.Debugf("Error pulling image (%s) from %s, mirror: %s, %s", img.Tag, repoInfo.CanonicalName, ep, err)
197
+					logrus.Debugf("Error pulling image (%s) from %s, mirror: %s, %s", img.Tag, repoInfo.CanonicalName, ep, err)
198 198
 					continue
199 199
 				}
200 200
 				layers_downloaded = layers_downloaded || is_downloaded
... ...
@@ -281,7 +281,7 @@ func (s *TagStore) pullImage(r *registry.Session, out io.Writer, imgID, endpoint
281 281
 
282 282
 		// ensure no two downloads of the same layer happen at the same time
283 283
 		if c, err := s.poolAdd("pull", "layer:"+id); err != nil {
284
-			log.Debugf("Image (id: %s) pull is already running, skipping: %v", id, err)
284
+			logrus.Debugf("Image (id: %s) pull is already running, skipping: %v", id, err)
285 285
 			<-c
286 286
 		}
287 287
 		defer s.poolRemove("pull", "layer:"+id)
... ...
@@ -387,7 +387,7 @@ func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out
387 387
 	endpoint, err := r.V2RegistryEndpoint(repoInfo.Index)
388 388
 	if err != nil {
389 389
 		if repoInfo.Index.Official {
390
-			log.Debugf("Unable to pull from V2 registry, falling back to v1: %s", err)
390
+			logrus.Debugf("Unable to pull from V2 registry, falling back to v1: %s", err)
391 391
 			return ErrV2RegistryUnavailable
392 392
 		}
393 393
 		return fmt.Errorf("error getting registry endpoint: %s", err)
... ...
@@ -398,7 +398,7 @@ func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out
398 398
 	}
399 399
 	var layersDownloaded bool
400 400
 	if tag == "" {
401
-		log.Debugf("Pulling tag list from V2 registry for %s", repoInfo.CanonicalName)
401
+		logrus.Debugf("Pulling tag list from V2 registry for %s", repoInfo.CanonicalName)
402 402
 		tags, err := r.GetV2RemoteTags(endpoint, repoInfo.RemoteName, auth)
403 403
 		if err != nil {
404 404
 			return err
... ...
@@ -430,7 +430,7 @@ func (s *TagStore) pullV2Repository(eng *engine.Engine, r *registry.Session, out
430 430
 }
431 431
 
432 432
 func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Writer, endpoint *registry.Endpoint, repoInfo *registry.RepositoryInfo, tag string, sf *streamformatter.StreamFormatter, parallel bool, auth *registry.RequestAuthorization) (bool, error) {
433
-	log.Debugf("Pulling tag from V2 registry: %q", tag)
433
+	logrus.Debugf("Pulling tag from V2 registry: %q", tag)
434 434
 
435 435
 	manifestBytes, manifestDigest, err := r.GetV2ImageManifest(endpoint, repoInfo.RemoteName, tag, auth)
436 436
 	if err != nil {
... ...
@@ -449,7 +449,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
449 449
 	}
450 450
 
451 451
 	if verified {
452
-		log.Printf("Image manifest for %s has been verified", utils.ImageReference(repoInfo.CanonicalName, tag))
452
+		logrus.Printf("Image manifest for %s has been verified", utils.ImageReference(repoInfo.CanonicalName, tag))
453 453
 	}
454 454
 	out.Write(sf.FormatStatus(tag, "Pulling from %s", repoInfo.CanonicalName))
455 455
 
... ...
@@ -469,7 +469,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
469 469
 
470 470
 		// Check if exists
471 471
 		if s.graph.Exists(img.ID) {
472
-			log.Debugf("Image already exists: %s", img.ID)
472
+			logrus.Debugf("Image already exists: %s", img.ID)
473 473
 			continue
474 474
 		}
475 475
 
... ...
@@ -482,7 +482,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
482 482
 		out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), "Pulling fs layer", nil))
483 483
 
484 484
 		downloadFunc := func(di *downloadInfo) error {
485
-			log.Debugf("pulling blob %q to V1 img %s", sumStr, img.ID)
485
+			logrus.Debugf("pulling blob %q to V1 img %s", sumStr, img.ID)
486 486
 
487 487
 			if c, err := s.poolAdd("pull", "img:"+img.ID); err != nil {
488 488
 				if c != nil {
... ...
@@ -490,7 +490,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
490 490
 					<-c
491 491
 					out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), "Download complete", nil))
492 492
 				} else {
493
-					log.Debugf("Image (id: %s) pull is already running, skipping: %v", img.ID, err)
493
+					logrus.Debugf("Image (id: %s) pull is already running, skipping: %v", img.ID, err)
494 494
 				}
495 495
 			} else {
496 496
 				defer s.poolRemove("pull", "img:"+img.ID)
... ...
@@ -525,13 +525,13 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
525 525
 				out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), "Verifying Checksum", nil))
526 526
 
527 527
 				if !verifier.Verified() {
528
-					log.Infof("Image verification failed: checksum mismatch for %q", di.digest.String())
528
+					logrus.Infof("Image verification failed: checksum mismatch for %q", di.digest.String())
529 529
 					verified = false
530 530
 				}
531 531
 
532 532
 				out.Write(sf.FormatProgress(stringid.TruncateID(img.ID), "Download complete", nil))
533 533
 
534
-				log.Debugf("Downloaded %s to tempfile %s", img.ID, tmpFile.Name())
534
+				logrus.Debugf("Downloaded %s to tempfile %s", img.ID, tmpFile.Name())
535 535
 				di.tmpFile = tmpFile
536 536
 				di.length = l
537 537
 				di.downloaded = true
... ...
@@ -12,7 +12,7 @@ import (
12 12
 	"strings"
13 13
 	"sync"
14 14
 
15
-	log "github.com/Sirupsen/logrus"
15
+	"github.com/Sirupsen/logrus"
16 16
 	"github.com/docker/distribution/digest"
17 17
 	"github.com/docker/docker/engine"
18 18
 	"github.com/docker/docker/image"
... ...
@@ -75,14 +75,14 @@ func (s *TagStore) getImageList(localRepo map[string]string, requestedTag string
75 75
 	if len(imageList) == 0 {
76 76
 		return nil, nil, fmt.Errorf("No images found for the requested repository / tag")
77 77
 	}
78
-	log.Debugf("Image list: %v", imageList)
79
-	log.Debugf("Tags by image: %v", tagsByImage)
78
+	logrus.Debugf("Image list: %v", imageList)
79
+	logrus.Debugf("Tags by image: %v", tagsByImage)
80 80
 
81 81
 	return imageList, tagsByImage, nil
82 82
 }
83 83
 
84 84
 func (s *TagStore) getImageTags(localRepo map[string]string, askedTag string) ([]string, error) {
85
-	log.Debugf("Checking %s against %#v", askedTag, localRepo)
85
+	logrus.Debugf("Checking %s against %#v", askedTag, localRepo)
86 86
 	if len(askedTag) > 0 {
87 87
 		if _, ok := localRepo[askedTag]; !ok || utils.DigestReference(askedTag) {
88 88
 			return nil, fmt.Errorf("Tag does not exist: %s", askedTag)
... ...
@@ -136,7 +136,7 @@ func lookupImageOnEndpoint(wg *sync.WaitGroup, r *registry.Session, out io.Write
136 136
 	defer wg.Done()
137 137
 	for image := range images {
138 138
 		if err := r.LookupRemoteImage(image.id, image.endpoint, image.tokens); err != nil {
139
-			log.Errorf("Error in LookupRemoteImage: %s", err)
139
+			logrus.Errorf("Error in LookupRemoteImage: %s", err)
140 140
 			imagesToPush <- image.id
141 141
 			continue
142 142
 		}
... ...
@@ -205,7 +205,7 @@ func (s *TagStore) pushImageToEndpoint(endpoint string, out io.Writer, remoteNam
205 205
 func (s *TagStore) pushRepository(r *registry.Session, out io.Writer,
206 206
 	repoInfo *registry.RepositoryInfo, localRepo map[string]string,
207 207
 	tag string, sf *streamformatter.StreamFormatter) error {
208
-	log.Debugf("Local repo: %s", localRepo)
208
+	logrus.Debugf("Local repo: %s", localRepo)
209 209
 	out = utils.NewWriteFlusher(out)
210 210
 	imgList, tags, err := s.getImageList(localRepo, tag)
211 211
 	if err != nil {
... ...
@@ -214,9 +214,9 @@ func (s *TagStore) pushRepository(r *registry.Session, out io.Writer,
214 214
 	out.Write(sf.FormatStatus("", "Sending image list"))
215 215
 
216 216
 	imageIndex := s.createImageIndex(imgList, tags)
217
-	log.Debugf("Preparing to push %s with the following images and tags", localRepo)
217
+	logrus.Debugf("Preparing to push %s with the following images and tags", localRepo)
218 218
 	for _, data := range imageIndex {
219
-		log.Debugf("Pushing ID: %s with Tag: %s", data.ID, data.Tag)
219
+		logrus.Debugf("Pushing ID: %s with Tag: %s", data.ID, data.Tag)
220 220
 	}
221 221
 	// Register all the images in a repository with the registry
222 222
 	// If an image is not in this list it will not be associated with the repository
... ...
@@ -267,7 +267,7 @@ func (s *TagStore) pushImage(r *registry.Session, out io.Writer, imgID, ep strin
267 267
 	defer os.RemoveAll(layerData.Name())
268 268
 
269 269
 	// Send the layer
270
-	log.Debugf("rendered layer for %s of [%d] size", imgData.ID, layerData.Size)
270
+	logrus.Debugf("rendered layer for %s of [%d] size", imgData.ID, layerData.Size)
271 271
 
272 272
 	checksum, checksumPayload, err := r.PushImageLayerRegistry(imgData.ID,
273 273
 		progressreader.New(progressreader.Config{
... ...
@@ -297,7 +297,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
297 297
 	endpoint, err := r.V2RegistryEndpoint(repoInfo.Index)
298 298
 	if err != nil {
299 299
 		if repoInfo.Index.Official {
300
-			log.Debugf("Unable to push to V2 registry, falling back to v1: %s", err)
300
+			logrus.Debugf("Unable to push to V2 registry, falling back to v1: %s", err)
301 301
 			return ErrV2RegistryUnavailable
302 302
 		}
303 303
 		return fmt.Errorf("error getting registry endpoint: %s", err)
... ...
@@ -317,7 +317,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
317 317
 	}
318 318
 
319 319
 	for _, tag := range tags {
320
-		log.Debugf("Pushing repository: %s:%s", repoInfo.CanonicalName, tag)
320
+		logrus.Debugf("Pushing repository: %s:%s", repoInfo.CanonicalName, tag)
321 321
 
322 322
 		layerId, exists := localRepo[tag]
323 323
 		if !exists {
... ...
@@ -358,7 +358,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
358 358
 
359 359
 		// Schema version 1 requires layer ordering from top to root
360 360
 		for i, layer := range layers {
361
-			log.Debugf("Pushing layer: %s", layer.ID)
361
+			logrus.Debugf("Pushing layer: %s", layer.ID)
362 362
 
363 363
 			if layer.Config != nil && metadata.Image != layer.ID {
364 364
 				err = runconfig.Merge(&metadata, layer.Config)
... ...
@@ -411,7 +411,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
411 411
 			return fmt.Errorf("invalid manifest: %s", err)
412 412
 		}
413 413
 
414
-		log.Debugf("Pushing %s:%s to v2 repository", repoInfo.LocalName, tag)
414
+		logrus.Debugf("Pushing %s:%s to v2 repository", repoInfo.LocalName, tag)
415 415
 		mBytes, err := json.MarshalIndent(m, "", "   ")
416 416
 		if err != nil {
417 417
 			return err
... ...
@@ -429,7 +429,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
429 429
 		if err != nil {
430 430
 			return err
431 431
 		}
432
-		log.Infof("Signed manifest for %s:%s using daemon's key: %s", repoInfo.LocalName, tag, s.trustKey.KeyID())
432
+		logrus.Infof("Signed manifest for %s:%s using daemon's key: %s", repoInfo.LocalName, tag, s.trustKey.KeyID())
433 433
 
434 434
 		// push the manifest
435 435
 		digest, err := r.PutV2ImageManifest(endpoint, repoInfo.RemoteName, tag, signedBody, mBytes, auth)
... ...
@@ -473,7 +473,7 @@ func (s *TagStore) pushV2Image(r *registry.Session, img *image.Image, endpoint *
473 473
 	dgst := digest.NewDigest("sha256", h)
474 474
 
475 475
 	// Send the layer
476
-	log.Debugf("rendered layer for %s of [%d] size", img.ID, size)
476
+	logrus.Debugf("rendered layer for %s of [%d] size", img.ID, size)
477 477
 
478 478
 	if err := r.PutV2ImageBlob(endpoint, imageName, dgst.Algorithm(), dgst.Hex(),
479 479
 		progressreader.New(progressreader.Config{
... ...
@@ -4,7 +4,7 @@ import (
4 4
 	"fmt"
5 5
 	"io"
6 6
 
7
-	log "github.com/Sirupsen/logrus"
7
+	"github.com/Sirupsen/logrus"
8 8
 	"github.com/docker/docker/engine"
9 9
 	"github.com/docker/docker/image"
10 10
 )
... ...
@@ -174,7 +174,7 @@ func (s *TagStore) CmdTarLayer(job *engine.Job) error {
174 174
 		if err != nil {
175 175
 			return err
176 176
 		}
177
-		log.Debugf("rendered layer for %s of [%d] size", image.ID, written)
177
+		logrus.Debugf("rendered layer for %s of [%d] size", image.ID, written)
178 178
 		return nil
179 179
 	}
180 180
 	return fmt.Errorf("No such image: %s", name)
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"testing"
10 10
 	"time"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/docker/api/client"
14 14
 	"github.com/docker/docker/daemon"
15 15
 	"github.com/docker/docker/pkg/stringid"
... ...
@@ -337,7 +337,7 @@ func TestAttachDisconnect(t *testing.T) {
337 337
 	go func() {
338 338
 		// Start a process in daemon mode
339 339
 		if err := cli.CmdRun("-d", "-i", unitTestImageID, "/bin/cat"); err != nil {
340
-			log.Debugf("Error CmdRun: %s", err)
340
+			logrus.Debugf("Error CmdRun: %s", err)
341 341
 		}
342 342
 	}()
343 343
 
... ...
@@ -16,7 +16,7 @@ import (
16 16
 	"testing"
17 17
 	"time"
18 18
 
19
-	log "github.com/Sirupsen/logrus"
19
+	"github.com/Sirupsen/logrus"
20 20
 	"github.com/docker/docker/daemon"
21 21
 	"github.com/docker/docker/daemon/execdriver"
22 22
 	"github.com/docker/docker/engine"
... ...
@@ -94,23 +94,23 @@ func init() {
94 94
 	}
95 95
 
96 96
 	if uid := syscall.Geteuid(); uid != 0 {
97
-		log.Fatalf("docker tests need to be run as root")
97
+		logrus.Fatalf("docker tests need to be run as root")
98 98
 	}
99 99
 
100 100
 	// Copy dockerinit into our current testing directory, if provided (so we can test a separate dockerinit binary)
101 101
 	if dockerinit := os.Getenv("TEST_DOCKERINIT_PATH"); dockerinit != "" {
102 102
 		src, err := os.Open(dockerinit)
103 103
 		if err != nil {
104
-			log.Fatalf("Unable to open TEST_DOCKERINIT_PATH: %s", err)
104
+			logrus.Fatalf("Unable to open TEST_DOCKERINIT_PATH: %s", err)
105 105
 		}
106 106
 		defer src.Close()
107 107
 		dst, err := os.OpenFile(filepath.Join(filepath.Dir(utils.SelfPath()), "dockerinit"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0555)
108 108
 		if err != nil {
109
-			log.Fatalf("Unable to create dockerinit in test directory: %s", err)
109
+			logrus.Fatalf("Unable to create dockerinit in test directory: %s", err)
110 110
 		}
111 111
 		defer dst.Close()
112 112
 		if _, err := io.Copy(dst, src); err != nil {
113
-			log.Fatalf("Unable to copy dockerinit to TEST_DOCKERINIT_PATH: %s", err)
113
+			logrus.Fatalf("Unable to copy dockerinit to TEST_DOCKERINIT_PATH: %s", err)
114 114
 		}
115 115
 		dst.Close()
116 116
 		src.Close()
... ...
@@ -137,14 +137,14 @@ func setupBaseImage() {
137 137
 		job = eng.Job("pull", unitTestImageName)
138 138
 		job.Stdout.Add(ioutils.NopWriteCloser(os.Stdout))
139 139
 		if err := job.Run(); err != nil {
140
-			log.Fatalf("Unable to pull the test image: %s", err)
140
+			logrus.Fatalf("Unable to pull the test image: %s", err)
141 141
 		}
142 142
 	}
143 143
 }
144 144
 
145 145
 func spawnGlobalDaemon() {
146 146
 	if globalDaemon != nil {
147
-		log.Debugf("Global daemon already exists. Skipping.")
147
+		logrus.Debugf("Global daemon already exists. Skipping.")
148 148
 		return
149 149
 	}
150 150
 	t := std_log.New(os.Stderr, "", 0)
... ...
@@ -154,7 +154,7 @@ func spawnGlobalDaemon() {
154 154
 
155 155
 	// Spawn a Daemon
156 156
 	go func() {
157
-		log.Debugf("Spawning global daemon for integration tests")
157
+		logrus.Debugf("Spawning global daemon for integration tests")
158 158
 		listenURL := &url.URL{
159 159
 			Scheme: testDaemonProto,
160 160
 			Host:   testDaemonAddr,
... ...
@@ -162,7 +162,7 @@ func spawnGlobalDaemon() {
162 162
 		job := eng.Job("serveapi", listenURL.String())
163 163
 		job.SetenvBool("Logging", true)
164 164
 		if err := job.Run(); err != nil {
165
-			log.Fatalf("Unable to spawn the test daemon: %s", err)
165
+			logrus.Fatalf("Unable to spawn the test daemon: %s", err)
166 166
 		}
167 167
 	}()
168 168
 
... ...
@@ -171,7 +171,7 @@ func spawnGlobalDaemon() {
171 171
 	time.Sleep(time.Second)
172 172
 
173 173
 	if err := eng.Job("acceptconnections").Run(); err != nil {
174
-		log.Fatalf("Unable to accept connections for test api: %s", err)
174
+		logrus.Fatalf("Unable to accept connections for test api: %s", err)
175 175
 	}
176 176
 }
177 177
 
... ...
@@ -204,7 +204,7 @@ func spawnHttpsDaemon(addr, cacert, cert, key string) *engine.Engine {
204 204
 
205 205
 	// Spawn a Daemon
206 206
 	go func() {
207
-		log.Debugf("Spawning https daemon for integration tests")
207
+		logrus.Debugf("Spawning https daemon for integration tests")
208 208
 		listenURL := &url.URL{
209 209
 			Scheme: testDaemonHttpsProto,
210 210
 			Host:   addr,
... ...
@@ -217,7 +217,7 @@ func spawnHttpsDaemon(addr, cacert, cert, key string) *engine.Engine {
217 217
 		job.Setenv("TlsCert", cert)
218 218
 		job.Setenv("TlsKey", key)
219 219
 		if err := job.Run(); err != nil {
220
-			log.Fatalf("Unable to spawn the test daemon: %s", err)
220
+			logrus.Fatalf("Unable to spawn the test daemon: %s", err)
221 221
 		}
222 222
 	}()
223 223
 
... ...
@@ -225,7 +225,7 @@ func spawnHttpsDaemon(addr, cacert, cert, key string) *engine.Engine {
225 225
 	time.Sleep(time.Second)
226 226
 
227 227
 	if err := eng.Job("acceptconnections").Run(); err != nil {
228
-		log.Fatalf("Unable to accept connections for test api: %s", err)
228
+		logrus.Fatalf("Unable to accept connections for test api: %s", err)
229 229
 	}
230 230
 	return eng
231 231
 }
... ...
@@ -235,14 +235,14 @@ func spawnHttpsDaemon(addr, cacert, cert, key string) *engine.Engine {
235 235
 func GetTestImage(daemon *daemon.Daemon) *image.Image {
236 236
 	imgs, err := daemon.Graph().Map()
237 237
 	if err != nil {
238
-		log.Fatalf("Unable to get the test image: %s", err)
238
+		logrus.Fatalf("Unable to get the test image: %s", err)
239 239
 	}
240 240
 	for _, image := range imgs {
241 241
 		if image.ID == unitTestImageID {
242 242
 			return image
243 243
 		}
244 244
 	}
245
-	log.Fatalf("Test image %v not found in %s: %s", unitTestImageID, daemon.Graph().Root, imgs)
245
+	logrus.Fatalf("Test image %v not found in %s: %s", unitTestImageID, daemon.Graph().Root, imgs)
246 246
 	return nil
247 247
 }
248 248
 
... ...
@@ -707,9 +707,9 @@ func TestRandomContainerName(t *testing.T) {
707 707
 	}
708 708
 
709 709
 	if c, err := daemon.Get(container.Name); err != nil {
710
-		log.Fatalf("Could not lookup container %s by its name", container.Name)
710
+		logrus.Fatalf("Could not lookup container %s by its name", container.Name)
711 711
 	} else if c.ID != containerID {
712
-		log.Fatalf("Looking up container name %s returned id %s instead of %s", container.Name, c.ID, containerID)
712
+		logrus.Fatalf("Looking up container name %s returned id %s instead of %s", container.Name, c.ID, containerID)
713 713
 	}
714 714
 }
715 715
 
... ...
@@ -18,7 +18,7 @@ import (
18 18
 
19 19
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
20 20
 
21
-	log "github.com/Sirupsen/logrus"
21
+	"github.com/Sirupsen/logrus"
22 22
 	"github.com/docker/docker/pkg/fileutils"
23 23
 	"github.com/docker/docker/pkg/pools"
24 24
 	"github.com/docker/docker/pkg/promise"
... ...
@@ -78,7 +78,7 @@ func DetectCompression(source []byte) Compression {
78 78
 		Xz:    {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},
79 79
 	} {
80 80
 		if len(source) < len(m) {
81
-			log.Debugf("Len too short")
81
+			logrus.Debugf("Len too short")
82 82
 			continue
83 83
 		}
84 84
 		if bytes.Compare(m, source[:len(m)]) == 0 {
... ...
@@ -331,7 +331,7 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
331 331
 		}
332 332
 
333 333
 	case tar.TypeXGlobalHeader:
334
-		log.Debugf("PAX Global Extended Headers found and ignored")
334
+		logrus.Debugf("PAX Global Extended Headers found and ignored")
335 335
 		return nil
336 336
 
337 337
 	default:
... ...
@@ -426,7 +426,7 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
426 426
 		for _, include := range options.IncludeFiles {
427 427
 			filepath.Walk(filepath.Join(srcPath, include), func(filePath string, f os.FileInfo, err error) error {
428 428
 				if err != nil {
429
-					log.Debugf("Tar: Can't stat file %s to tar: %s", srcPath, err)
429
+					logrus.Debugf("Tar: Can't stat file %s to tar: %s", srcPath, err)
430 430
 					return nil
431 431
 				}
432 432
 
... ...
@@ -447,7 +447,7 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
447 447
 				if include != relFilePath {
448 448
 					skip, err = fileutils.Matches(relFilePath, options.ExcludePatterns)
449 449
 					if err != nil {
450
-						log.Debugf("Error matching %s", relFilePath, err)
450
+						logrus.Debugf("Error matching %s", relFilePath, err)
451 451
 						return err
452 452
 					}
453 453
 				}
... ...
@@ -474,7 +474,7 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
474 474
 				}
475 475
 
476 476
 				if err := ta.addTarFile(filePath, relFilePath); err != nil {
477
-					log.Debugf("Can't add file %s to tar: %s", filePath, err)
477
+					logrus.Debugf("Can't add file %s to tar: %s", filePath, err)
478 478
 				}
479 479
 				return nil
480 480
 			})
... ...
@@ -482,13 +482,13 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
482 482
 
483 483
 		// Make sure to check the error on Close.
484 484
 		if err := ta.TarWriter.Close(); err != nil {
485
-			log.Debugf("Can't close tar writer: %s", err)
485
+			logrus.Debugf("Can't close tar writer: %s", err)
486 486
 		}
487 487
 		if err := compressWriter.Close(); err != nil {
488
-			log.Debugf("Can't close compress writer: %s", err)
488
+			logrus.Debugf("Can't close compress writer: %s", err)
489 489
 		}
490 490
 		if err := pipeWriter.Close(); err != nil {
491
-			log.Debugf("Can't close pipe writer: %s", err)
491
+			logrus.Debugf("Can't close pipe writer: %s", err)
492 492
 		}
493 493
 	}()
494 494
 
... ...
@@ -606,7 +606,7 @@ func Untar(archive io.Reader, dest string, options *TarOptions) error {
606 606
 }
607 607
 
608 608
 func (archiver *Archiver) TarUntar(src, dst string) error {
609
-	log.Debugf("TarUntar(%s %s)", src, dst)
609
+	logrus.Debugf("TarUntar(%s %s)", src, dst)
610 610
 	archive, err := TarWithOptions(src, &TarOptions{Compression: Uncompressed})
611 611
 	if err != nil {
612 612
 		return err
... ...
@@ -648,11 +648,11 @@ func (archiver *Archiver) CopyWithTar(src, dst string) error {
648 648
 		return archiver.CopyFileWithTar(src, dst)
649 649
 	}
650 650
 	// Create dst, copy src's content into it
651
-	log.Debugf("Creating dest directory: %s", dst)
651
+	logrus.Debugf("Creating dest directory: %s", dst)
652 652
 	if err := os.MkdirAll(dst, 0755); err != nil && !os.IsExist(err) {
653 653
 		return err
654 654
 	}
655
-	log.Debugf("Calling TarUntar(%s, %s)", src, dst)
655
+	logrus.Debugf("Calling TarUntar(%s, %s)", src, dst)
656 656
 	return archiver.TarUntar(src, dst)
657 657
 }
658 658
 
... ...
@@ -665,7 +665,7 @@ func CopyWithTar(src, dst string) error {
665 665
 }
666 666
 
667 667
 func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
668
-	log.Debugf("CopyFileWithTar(%s, %s)", src, dst)
668
+	logrus.Debugf("CopyFileWithTar(%s, %s)", src, dst)
669 669
 	srcSt, err := os.Stat(src)
670 670
 	if err != nil {
671 671
 		return err
... ...
@@ -13,7 +13,7 @@ import (
13 13
 
14 14
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
15 15
 
16
-	log "github.com/Sirupsen/logrus"
16
+	"github.com/Sirupsen/logrus"
17 17
 	"github.com/docker/docker/pkg/pools"
18 18
 	"github.com/docker/docker/pkg/system"
19 19
 )
... ...
@@ -401,22 +401,22 @@ func ExportChanges(dir string, changes []Change) (Archive, error) {
401 401
 					ChangeTime: timestamp,
402 402
 				}
403 403
 				if err := ta.TarWriter.WriteHeader(hdr); err != nil {
404
-					log.Debugf("Can't write whiteout header: %s", err)
404
+					logrus.Debugf("Can't write whiteout header: %s", err)
405 405
 				}
406 406
 			} else {
407 407
 				path := filepath.Join(dir, change.Path)
408 408
 				if err := ta.addTarFile(path, change.Path[1:]); err != nil {
409
-					log.Debugf("Can't add file %s to tar: %s", path, err)
409
+					logrus.Debugf("Can't add file %s to tar: %s", path, err)
410 410
 				}
411 411
 			}
412 412
 		}
413 413
 
414 414
 		// Make sure to check the error on Close.
415 415
 		if err := ta.TarWriter.Close(); err != nil {
416
-			log.Debugf("Can't close layer: %s", err)
416
+			logrus.Debugf("Can't close layer: %s", err)
417 417
 		}
418 418
 		if err := writer.Close(); err != nil {
419
-			log.Debugf("failed close Changes writer: %s", err)
419
+			logrus.Debugf("failed close Changes writer: %s", err)
420 420
 		}
421 421
 	}()
422 422
 	return reader, nil
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"sync"
7 7
 	"time"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 	"github.com/docker/docker/pkg/jsonlog"
11 11
 )
12 12
 
... ...
@@ -61,7 +61,7 @@ func (w *BroadcastWriter) Write(p []byte) (n int, err error) {
61 61
 			jsonLog := jsonlog.JSONLog{Log: line, Stream: stream, Created: created}
62 62
 			err = jsonLog.MarshalJSONBuf(w.jsLogBuf)
63 63
 			if err != nil {
64
-				log.Errorf("Error making JSON log line: %s", err)
64
+				logrus.Errorf("Error making JSON log line: %s", err)
65 65
 				continue
66 66
 			}
67 67
 			w.jsLogBuf.WriteByte('\n')
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"os"
8 8
 	"syscall"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 )
12 12
 
13 13
 func stringToLoopName(src string) [LoNameSize]uint8 {
... ...
@@ -39,20 +39,20 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
39 39
 		fi, err := os.Stat(target)
40 40
 		if err != nil {
41 41
 			if os.IsNotExist(err) {
42
-				log.Errorf("There are no more loopback devices available.")
42
+				logrus.Errorf("There are no more loopback devices available.")
43 43
 			}
44 44
 			return nil, ErrAttachLoopbackDevice
45 45
 		}
46 46
 
47 47
 		if fi.Mode()&os.ModeDevice != os.ModeDevice {
48
-			log.Errorf("Loopback device %s is not a block device.", target)
48
+			logrus.Errorf("Loopback device %s is not a block device.", target)
49 49
 			continue
50 50
 		}
51 51
 
52 52
 		// OpenFile adds O_CLOEXEC
53 53
 		loopFile, err = os.OpenFile(target, os.O_RDWR, 0644)
54 54
 		if err != nil {
55
-			log.Errorf("Error opening loopback device: %s", err)
55
+			logrus.Errorf("Error opening loopback device: %s", err)
56 56
 			return nil, ErrAttachLoopbackDevice
57 57
 		}
58 58
 
... ...
@@ -62,7 +62,7 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
62 62
 
63 63
 			// If the error is EBUSY, then try the next loopback
64 64
 			if err != syscall.EBUSY {
65
-				log.Errorf("Cannot set up loopback device %s: %s", target, err)
65
+				logrus.Errorf("Cannot set up loopback device %s: %s", target, err)
66 66
 				return nil, ErrAttachLoopbackDevice
67 67
 			}
68 68
 
... ...
@@ -75,7 +75,7 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
75 75
 
76 76
 	// This can't happen, but let's be sure
77 77
 	if loopFile == nil {
78
-		log.Errorf("Unreachable code reached! Error attaching %s to a loopback device.", sparseFile.Name())
78
+		logrus.Errorf("Unreachable code reached! Error attaching %s to a loopback device.", sparseFile.Name())
79 79
 		return nil, ErrAttachLoopbackDevice
80 80
 	}
81 81
 
... ...
@@ -91,13 +91,13 @@ func AttachLoopDevice(sparseName string) (loop *os.File, err error) {
91 91
 	// loopback from index 0.
92 92
 	startIndex, err := getNextFreeLoopbackIndex()
93 93
 	if err != nil {
94
-		log.Debugf("Error retrieving the next available loopback: %s", err)
94
+		logrus.Debugf("Error retrieving the next available loopback: %s", err)
95 95
 	}
96 96
 
97 97
 	// OpenFile adds O_CLOEXEC
98 98
 	sparseFile, err := os.OpenFile(sparseName, os.O_RDWR, 0644)
99 99
 	if err != nil {
100
-		log.Errorf("Error opening sparse file %s: %s", sparseName, err)
100
+		logrus.Errorf("Error opening sparse file %s: %s", sparseName, err)
101 101
 		return nil, ErrAttachLoopbackDevice
102 102
 	}
103 103
 	defer sparseFile.Close()
... ...
@@ -115,11 +115,11 @@ func AttachLoopDevice(sparseName string) (loop *os.File, err error) {
115 115
 	}
116 116
 
117 117
 	if err := ioctlLoopSetStatus64(loopFile.Fd(), loopInfo); err != nil {
118
-		log.Errorf("Cannot set up loopback device info: %s", err)
118
+		logrus.Errorf("Cannot set up loopback device info: %s", err)
119 119
 
120 120
 		// If the call failed, then free the loopback device
121 121
 		if err := ioctlLoopClrFd(loopFile.Fd()); err != nil {
122
-			log.Errorf("Error while cleaning up the loopback device")
122
+			logrus.Errorf("Error while cleaning up the loopback device")
123 123
 		}
124 124
 		loopFile.Close()
125 125
 		return nil, ErrAttachLoopbackDevice
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"runtime"
10 10
 	"syscall"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 )
14 14
 
15 15
 type DevmapperLogger interface {
... ...
@@ -237,7 +237,7 @@ func (t *Task) GetNextTarget(next uintptr) (nextPtr uintptr, start uint64,
237 237
 func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
238 238
 	loopInfo, err := ioctlLoopGetStatus64(file.Fd())
239 239
 	if err != nil {
240
-		log.Errorf("Error get loopback backing file: %s", err)
240
+		logrus.Errorf("Error get loopback backing file: %s", err)
241 241
 		return 0, 0, ErrGetLoopbackBackingFile
242 242
 	}
243 243
 	return loopInfo.loDevice, loopInfo.loInode, nil
... ...
@@ -245,7 +245,7 @@ func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
245 245
 
246 246
 func LoopbackSetCapacity(file *os.File) error {
247 247
 	if err := ioctlLoopSetCapacity(file.Fd(), 0); err != nil {
248
-		log.Errorf("Error loopbackSetCapacity: %s", err)
248
+		logrus.Errorf("Error loopbackSetCapacity: %s", err)
249 249
 		return ErrLoopbackSetCapacity
250 250
 	}
251 251
 	return nil
... ...
@@ -285,7 +285,7 @@ func FindLoopDeviceFor(file *os.File) *os.File {
285 285
 
286 286
 func UdevWait(cookie uint) error {
287 287
 	if res := DmUdevWait(cookie); res != 1 {
288
-		log.Debugf("Failed to wait on udev cookie %d", cookie)
288
+		logrus.Debugf("Failed to wait on udev cookie %d", cookie)
289 289
 		return ErrUdevWait
290 290
 	}
291 291
 	return nil
... ...
@@ -305,7 +305,7 @@ func LogInit(logger DevmapperLogger) {
305 305
 
306 306
 func SetDevDir(dir string) error {
307 307
 	if res := DmSetDevDir(dir); res != 1 {
308
-		log.Debugf("Error dm_set_dev_dir")
308
+		logrus.Debugf("Error dm_set_dev_dir")
309 309
 		return ErrSetDevDir
310 310
 	}
311 311
 	return nil
... ...
@@ -348,8 +348,8 @@ func CookieSupported() bool {
348 348
 
349 349
 // Useful helper for cleanup
350 350
 func RemoveDevice(name string) error {
351
-	log.Debugf("[devmapper] RemoveDevice START(%s)", name)
352
-	defer log.Debugf("[devmapper] RemoveDevice END(%s)", name)
351
+	logrus.Debugf("[devmapper] RemoveDevice START(%s)", name)
352
+	defer logrus.Debugf("[devmapper] RemoveDevice END(%s)", name)
353 353
 	task, err := TaskCreateNamed(DeviceRemove, name)
354 354
 	if task == nil {
355 355
 		return err
... ...
@@ -375,7 +375,7 @@ func RemoveDevice(name string) error {
375 375
 func GetBlockDeviceSize(file *os.File) (uint64, error) {
376 376
 	size, err := ioctlBlkGetSize64(file.Fd())
377 377
 	if err != nil {
378
-		log.Errorf("Error getblockdevicesize: %s", err)
378
+		logrus.Errorf("Error getblockdevicesize: %s", err)
379 379
 		return 0, ErrGetBlockSize
380 380
 	}
381 381
 	return uint64(size), nil
... ...
@@ -494,21 +494,21 @@ func GetDriverVersion() (string, error) {
494 494
 func GetStatus(name string) (uint64, uint64, string, string, error) {
495 495
 	task, err := TaskCreateNamed(DeviceStatus, name)
496 496
 	if task == nil {
497
-		log.Debugf("GetStatus: Error TaskCreateNamed: %s", err)
497
+		logrus.Debugf("GetStatus: Error TaskCreateNamed: %s", err)
498 498
 		return 0, 0, "", "", err
499 499
 	}
500 500
 	if err := task.Run(); err != nil {
501
-		log.Debugf("GetStatus: Error Run: %s", err)
501
+		logrus.Debugf("GetStatus: Error Run: %s", err)
502 502
 		return 0, 0, "", "", err
503 503
 	}
504 504
 
505 505
 	devinfo, err := task.GetInfo()
506 506
 	if err != nil {
507
-		log.Debugf("GetStatus: Error GetInfo: %s", err)
507
+		logrus.Debugf("GetStatus: Error GetInfo: %s", err)
508 508
 		return 0, 0, "", "", err
509 509
 	}
510 510
 	if devinfo.Exists == 0 {
511
-		log.Debugf("GetStatus: Non existing device %s", name)
511
+		logrus.Debugf("GetStatus: Non existing device %s", name)
512 512
 		return 0, 0, "", "", fmt.Errorf("Non existing device %s", name)
513 513
 	}
514 514
 
... ...
@@ -567,7 +567,7 @@ func ResumeDevice(name string) error {
567 567
 }
568 568
 
569 569
 func CreateDevice(poolName string, deviceId int) error {
570
-	log.Debugf("[devmapper] CreateDevice(poolName=%v, deviceId=%v)", poolName, deviceId)
570
+	logrus.Debugf("[devmapper] CreateDevice(poolName=%v, deviceId=%v)", poolName, deviceId)
571 571
 	task, err := TaskCreateNamed(DeviceTargetMsg, poolName)
572 572
 	if task == nil {
573 573
 		return err
... ...
@@ -1,7 +1,7 @@
1 1
 package fileutils
2 2
 
3 3
 import (
4
-	log "github.com/Sirupsen/logrus"
4
+	"github.com/Sirupsen/logrus"
5 5
 	"path/filepath"
6 6
 )
7 7
 
... ...
@@ -10,15 +10,15 @@ func Matches(relFilePath string, patterns []string) (bool, error) {
10 10
 	for _, exclude := range patterns {
11 11
 		matched, err := filepath.Match(exclude, relFilePath)
12 12
 		if err != nil {
13
-			log.Errorf("Error matching: %s (pattern: %s)", relFilePath, exclude)
13
+			logrus.Errorf("Error matching: %s (pattern: %s)", relFilePath, exclude)
14 14
 			return false, err
15 15
 		}
16 16
 		if matched {
17 17
 			if filepath.Clean(relFilePath) == "." {
18
-				log.Errorf("Can't exclude whole path, excluding pattern: %s", exclude)
18
+				logrus.Errorf("Can't exclude whole path, excluding pattern: %s", exclude)
19 19
 				continue
20 20
 			}
21
-			log.Debugf("Skipping excluded path: %s", relFilePath)
21
+			logrus.Debugf("Skipping excluded path: %s", relFilePath)
22 22
 			return true, nil
23 23
 		}
24 24
 	}
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"net/http"
7 7
 	"time"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 )
11 11
 
12 12
 type resumableRequestReader struct {
... ...
@@ -72,7 +72,7 @@ func (r *resumableRequestReader) Read(p []byte) (n int, err error) {
72 72
 		r.cleanUpResponse()
73 73
 	}
74 74
 	if err != nil && err != io.EOF {
75
-		log.Infof("encountered error during pull and clearing it before resume: %s", err)
75
+		logrus.Infof("encountered error during pull and clearing it before resume: %s", err)
76 76
 		err = nil
77 77
 	}
78 78
 	return n, err
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"strconv"
10 10
 	"strings"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 )
14 14
 
15 15
 type Action string
... ...
@@ -283,7 +283,7 @@ func Raw(args ...string) ([]byte, error) {
283 283
 		args = append([]string{"--wait"}, args...)
284 284
 	}
285 285
 
286
-	log.Debugf("%s, %v", iptablesPath, args)
286
+	logrus.Debugf("%s, %v", iptablesPath, args)
287 287
 
288 288
 	output, err := exec.Command(iptablesPath, args...).CombinedOutput()
289 289
 	if err != nil {
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"io"
7 7
 	"time"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 )
11 11
 
12 12
 type JSONLog struct {
... ...
@@ -39,7 +39,7 @@ func WriteLog(src io.Reader, dst io.Writer, format string) error {
39 39
 		if err := dec.Decode(l); err == io.EOF {
40 40
 			return nil
41 41
 		} else if err != nil {
42
-			log.Printf("Error streaming logs: %s", err)
42
+			logrus.Printf("Error streaming logs: %s", err)
43 43
 			return err
44 44
 		}
45 45
 		line, err := l.Format(format)
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"net"
6 6
 	"syscall"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 )
10 10
 
11 11
 type TCPProxy struct {
... ...
@@ -31,7 +31,7 @@ func NewTCPProxy(frontendAddr, backendAddr *net.TCPAddr) (*TCPProxy, error) {
31 31
 func (proxy *TCPProxy) clientLoop(client *net.TCPConn, quit chan bool) {
32 32
 	backend, err := net.DialTCP("tcp", nil, proxy.backendAddr)
33 33
 	if err != nil {
34
-		log.Printf("Can't forward traffic to backend tcp/%v: %s\n", proxy.backendAddr, err)
34
+		logrus.Printf("Can't forward traffic to backend tcp/%v: %s\n", proxy.backendAddr, err)
35 35
 		client.Close()
36 36
 		return
37 37
 	}
... ...
@@ -78,7 +78,7 @@ func (proxy *TCPProxy) Run() {
78 78
 	for {
79 79
 		client, err := proxy.listener.Accept()
80 80
 		if err != nil {
81
-			log.Printf("Stopping proxy on tcp/%v for tcp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err)
81
+			logrus.Printf("Stopping proxy on tcp/%v for tcp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err)
82 82
 			return
83 83
 		}
84 84
 		go proxy.clientLoop(client.(*net.TCPConn), quit)
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"syscall"
9 9
 	"time"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 )
13 13
 
14 14
 const (
... ...
@@ -105,7 +105,7 @@ func (proxy *UDPProxy) Run() {
105 105
 			// ECONNREFUSED like Read do (see comment in
106 106
 			// UDPProxy.replyLoop)
107 107
 			if !isClosedError(err) {
108
-				log.Printf("Stopping proxy on udp/%v for udp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err)
108
+				logrus.Printf("Stopping proxy on udp/%v for udp/%v (%s)", proxy.frontendAddr, proxy.backendAddr, err)
109 109
 			}
110 110
 			break
111 111
 		}
... ...
@@ -116,7 +116,7 @@ func (proxy *UDPProxy) Run() {
116 116
 		if !hit {
117 117
 			proxyConn, err = net.DialUDP("udp", nil, proxy.backendAddr)
118 118
 			if err != nil {
119
-				log.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err)
119
+				logrus.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err)
120 120
 				proxy.connTrackLock.Unlock()
121 121
 				continue
122 122
 			}
... ...
@@ -127,7 +127,7 @@ func (proxy *UDPProxy) Run() {
127 127
 		for i := 0; i != read; {
128 128
 			written, err := proxyConn.Write(readBuf[i:read])
129 129
 			if err != nil {
130
-				log.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err)
130
+				logrus.Printf("Can't proxy a datagram to udp/%s: %s\n", proxy.backendAddr, err)
131 131
 				break
132 132
 			}
133 133
 			i += written
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"strings"
9 9
 	"sync"
10 10
 
11
-	log "github.com/Sirupsen/logrus"
11
+	"github.com/Sirupsen/logrus"
12 12
 	"github.com/docker/docker/utils"
13 13
 )
14 14
 
... ...
@@ -99,10 +99,10 @@ func FilterResolvDns(resolvConf []byte, ipv6Enabled bool) ([]byte, bool) {
99 99
 	// if the resulting resolvConf has no more nameservers defined, add appropriate
100 100
 	// default DNS servers for IPv4 and (optionally) IPv6
101 101
 	if len(GetNameservers(cleanedResolvConf)) == 0 {
102
-		log.Infof("No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : %v", defaultIPv4Dns)
102
+		logrus.Infof("No non-localhost DNS nameservers are left in resolv.conf. Using default external servers : %v", defaultIPv4Dns)
103 103
 		dns := defaultIPv4Dns
104 104
 		if ipv6Enabled {
105
-			log.Infof("IPv6 enabled; Adding default IPv6 external servers : %v", defaultIPv6Dns)
105
+			logrus.Infof("IPv6 enabled; Adding default IPv6 external servers : %v", defaultIPv6Dns)
106 106
 			dns = append(dns, defaultIPv6Dns...)
107 107
 		}
108 108
 		cleanedResolvConf = append(cleanedResolvConf, []byte("\n"+strings.Join(dns, "\n"))...)
... ...
@@ -6,7 +6,7 @@ import (
6 6
 	"sync/atomic"
7 7
 	"syscall"
8 8
 
9
-	log "github.com/Sirupsen/logrus"
9
+	"github.com/Sirupsen/logrus"
10 10
 )
11 11
 
12 12
 // Trap sets up a simplified signal "trap", appropriate for common
... ...
@@ -29,7 +29,7 @@ func Trap(cleanup func()) {
29 29
 		interruptCount := uint32(0)
30 30
 		for sig := range c {
31 31
 			go func(sig os.Signal) {
32
-				log.Infof("Received signal '%v', starting shutdown of docker...", sig)
32
+				logrus.Infof("Received signal '%v', starting shutdown of docker...", sig)
33 33
 				switch sig {
34 34
 				case os.Interrupt, syscall.SIGTERM:
35 35
 					// If the user really wants to interrupt, let him do so.
... ...
@@ -43,7 +43,7 @@ func Trap(cleanup func()) {
43 43
 							return
44 44
 						}
45 45
 					} else {
46
-						log.Infof("Force shutdown of docker, interrupting cleanup")
46
+						logrus.Infof("Force shutdown of docker, interrupting cleanup")
47 47
 					}
48 48
 				case syscall.SIGQUIT:
49 49
 				}
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"errors"
6 6
 	"io"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 )
10 10
 
11 11
 const (
... ...
@@ -95,13 +95,13 @@ func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
95 95
 			nr += nr2
96 96
 			if er == io.EOF {
97 97
 				if nr < StdWriterPrefixLen {
98
-					log.Debugf("Corrupted prefix: %v", buf[:nr])
98
+					logrus.Debugf("Corrupted prefix: %v", buf[:nr])
99 99
 					return written, nil
100 100
 				}
101 101
 				break
102 102
 			}
103 103
 			if er != nil {
104
-				log.Debugf("Error reading header: %s", er)
104
+				logrus.Debugf("Error reading header: %s", er)
105 105
 				return 0, er
106 106
 			}
107 107
 		}
... ...
@@ -117,18 +117,18 @@ func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
117 117
 			// Write on stderr
118 118
 			out = dsterr
119 119
 		default:
120
-			log.Debugf("Error selecting output fd: (%d)", buf[StdWriterFdIndex])
120
+			logrus.Debugf("Error selecting output fd: (%d)", buf[StdWriterFdIndex])
121 121
 			return 0, ErrInvalidStdHeader
122 122
 		}
123 123
 
124 124
 		// Retrieve the size of the frame
125 125
 		frameSize = int(binary.BigEndian.Uint32(buf[StdWriterSizeIndex : StdWriterSizeIndex+4]))
126
-		log.Debugf("framesize: %d", frameSize)
126
+		logrus.Debugf("framesize: %d", frameSize)
127 127
 
128 128
 		// Check if the buffer is big enough to read the frame.
129 129
 		// Extend it if necessary.
130 130
 		if frameSize+StdWriterPrefixLen > bufLen {
131
-			log.Debugf("Extending buffer cap by %d (was %d)", frameSize+StdWriterPrefixLen-bufLen+1, len(buf))
131
+			logrus.Debugf("Extending buffer cap by %d (was %d)", frameSize+StdWriterPrefixLen-bufLen+1, len(buf))
132 132
 			buf = append(buf, make([]byte, frameSize+StdWriterPrefixLen-bufLen+1)...)
133 133
 			bufLen = len(buf)
134 134
 		}
... ...
@@ -140,13 +140,13 @@ func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
140 140
 			nr += nr2
141 141
 			if er == io.EOF {
142 142
 				if nr < frameSize+StdWriterPrefixLen {
143
-					log.Debugf("Corrupted frame: %v", buf[StdWriterPrefixLen:nr])
143
+					logrus.Debugf("Corrupted frame: %v", buf[StdWriterPrefixLen:nr])
144 144
 					return written, nil
145 145
 				}
146 146
 				break
147 147
 			}
148 148
 			if er != nil {
149
-				log.Debugf("Error reading frame: %s", er)
149
+				logrus.Debugf("Error reading frame: %s", er)
150 150
 				return 0, er
151 151
 			}
152 152
 		}
... ...
@@ -154,12 +154,12 @@ func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
154 154
 		// Write the retrieved frame (without header)
155 155
 		nw, ew = out.Write(buf[StdWriterPrefixLen : frameSize+StdWriterPrefixLen])
156 156
 		if ew != nil {
157
-			log.Debugf("Error writing frame: %s", ew)
157
+			logrus.Debugf("Error writing frame: %s", ew)
158 158
 			return 0, ew
159 159
 		}
160 160
 		// If the frame has not been fully written: error
161 161
 		if nw != frameSize {
162
-			log.Debugf("Error Short Write: (%d on %d)", nw, frameSize)
162
+			logrus.Debugf("Error Short Write: (%d on %d)", nw, frameSize)
163 163
 			return 0, io.ErrShortWrite
164 164
 		}
165 165
 		written += int64(nw)
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"os"
6 6
 	"path"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 	"github.com/docker/libcontainer/cgroups"
10 10
 )
11 11
 
... ...
@@ -20,20 +20,20 @@ func New(quiet bool) *SysInfo {
20 20
 	sysInfo := &SysInfo{}
21 21
 	if cgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint("memory"); err != nil {
22 22
 		if !quiet {
23
-			log.Warnf("%s", err)
23
+			logrus.Warnf("%s", err)
24 24
 		}
25 25
 	} else {
26 26
 		_, err1 := ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.limit_in_bytes"))
27 27
 		_, err2 := ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.soft_limit_in_bytes"))
28 28
 		sysInfo.MemoryLimit = err1 == nil && err2 == nil
29 29
 		if !sysInfo.MemoryLimit && !quiet {
30
-			log.Warnf("Your kernel does not support cgroup memory limit.")
30
+			logrus.Warnf("Your kernel does not support cgroup memory limit.")
31 31
 		}
32 32
 
33 33
 		_, err = ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.memsw.limit_in_bytes"))
34 34
 		sysInfo.SwapLimit = err == nil
35 35
 		if !sysInfo.SwapLimit && !quiet {
36
-			log.Warnf("Your kernel does not support cgroup swap limit.")
36
+			logrus.Warnf("Your kernel does not support cgroup swap limit.")
37 37
 		}
38 38
 	}
39 39
 
... ...
@@ -13,7 +13,7 @@ import (
13 13
 	"sync"
14 14
 	"time"
15 15
 
16
-	log "github.com/Sirupsen/logrus"
16
+	"github.com/Sirupsen/logrus"
17 17
 	"github.com/docker/docker/utils"
18 18
 )
19 19
 
... ...
@@ -66,7 +66,7 @@ func (auth *RequestAuthorization) getToken() (string, error) {
66 66
 	defer auth.tokenLock.Unlock()
67 67
 	now := time.Now()
68 68
 	if now.Before(auth.tokenExpiration) {
69
-		log.Debugf("Using cached token for %s", auth.authConfig.Username)
69
+		logrus.Debugf("Using cached token for %s", auth.authConfig.Username)
70 70
 		return auth.tokenCache, nil
71 71
 	}
72 72
 
... ...
@@ -78,7 +78,7 @@ func (auth *RequestAuthorization) getToken() (string, error) {
78 78
 		case "basic":
79 79
 			// no token necessary
80 80
 		case "bearer":
81
-			log.Debugf("Getting bearer token with %s for %s", challenge.Parameters, auth.authConfig.Username)
81
+			logrus.Debugf("Getting bearer token with %s for %s", challenge.Parameters, auth.authConfig.Username)
82 82
 			params := map[string]string{}
83 83
 			for k, v := range challenge.Parameters {
84 84
 				params[k] = v
... ...
@@ -93,7 +93,7 @@ func (auth *RequestAuthorization) getToken() (string, error) {
93 93
 
94 94
 			return token, nil
95 95
 		default:
96
-			log.Infof("Unsupported auth scheme: %q", challenge.Scheme)
96
+			logrus.Infof("Unsupported auth scheme: %q", challenge.Scheme)
97 97
 		}
98 98
 	}
99 99
 
... ...
@@ -245,7 +245,7 @@ func loginV1(authConfig *AuthConfig, registryEndpoint *Endpoint, factory *utils.
245 245
 		serverAddress = authConfig.ServerAddress
246 246
 	)
247 247
 
248
-	log.Debugf("attempting v1 login to registry endpoint %s", registryEndpoint)
248
+	logrus.Debugf("attempting v1 login to registry endpoint %s", registryEndpoint)
249 249
 
250 250
 	if serverAddress == "" {
251 251
 		return "", fmt.Errorf("Server Error: Server Address not set.")
... ...
@@ -349,7 +349,7 @@ func loginV1(authConfig *AuthConfig, registryEndpoint *Endpoint, factory *utils.
349 349
 // served by the v2 registry service provider. Whether this will be supported in the future
350 350
 // is to be determined.
351 351
 func loginV2(authConfig *AuthConfig, registryEndpoint *Endpoint, factory *utils.HTTPRequestFactory) (string, error) {
352
-	log.Debugf("attempting v2 login to registry endpoint %s", registryEndpoint)
352
+	logrus.Debugf("attempting v2 login to registry endpoint %s", registryEndpoint)
353 353
 	var (
354 354
 		err       error
355 355
 		allErrors []error
... ...
@@ -357,7 +357,7 @@ func loginV2(authConfig *AuthConfig, registryEndpoint *Endpoint, factory *utils.
357 357
 	)
358 358
 
359 359
 	for _, challenge := range registryEndpoint.AuthChallenges {
360
-		log.Debugf("trying %q auth challenge with params %s", challenge.Scheme, challenge.Parameters)
360
+		logrus.Debugf("trying %q auth challenge with params %s", challenge.Scheme, challenge.Parameters)
361 361
 
362 362
 		switch strings.ToLower(challenge.Scheme) {
363 363
 		case "basic":
... ...
@@ -373,7 +373,7 @@ func loginV2(authConfig *AuthConfig, registryEndpoint *Endpoint, factory *utils.
373 373
 			return "Login Succeeded", nil
374 374
 		}
375 375
 
376
-		log.Debugf("error trying auth challenge %q: %s", challenge.Scheme, err)
376
+		logrus.Debugf("error trying auth challenge %q: %s", challenge.Scheme, err)
377 377
 
378 378
 		allErrors = append(allErrors, err)
379 379
 	}
... ...
@@ -10,7 +10,7 @@ import (
10 10
 	"net/url"
11 11
 	"strings"
12 12
 
13
-	log "github.com/Sirupsen/logrus"
13
+	"github.com/Sirupsen/logrus"
14 14
 	"github.com/docker/docker/registry/v2"
15 15
 	"github.com/docker/docker/utils"
16 16
 )
... ...
@@ -57,7 +57,7 @@ func NewEndpoint(index *IndexInfo) (*Endpoint, error) {
57 57
 }
58 58
 
59 59
 func validateEndpoint(endpoint *Endpoint) error {
60
-	log.Debugf("pinging registry endpoint %s", endpoint)
60
+	logrus.Debugf("pinging registry endpoint %s", endpoint)
61 61
 
62 62
 	// Try HTTPS ping to registry
63 63
 	endpoint.URL.Scheme = "https"
... ...
@@ -69,7 +69,7 @@ func validateEndpoint(endpoint *Endpoint) error {
69 69
 		}
70 70
 
71 71
 		// If registry is insecure and HTTPS failed, fallback to HTTP.
72
-		log.Debugf("Error from registry %q marked as insecure: %v. Insecurely falling back to HTTP", endpoint, err)
72
+		logrus.Debugf("Error from registry %q marked as insecure: %v. Insecurely falling back to HTTP", endpoint, err)
73 73
 		endpoint.URL.Scheme = "http"
74 74
 
75 75
 		var err2 error
... ...
@@ -163,7 +163,7 @@ func (e *Endpoint) Ping() (RegistryInfo, error) {
163 163
 }
164 164
 
165 165
 func (e *Endpoint) pingV1(factory *utils.HTTPRequestFactory) (RegistryInfo, error) {
166
-	log.Debugf("attempting v1 ping for registry endpoint %s", e)
166
+	logrus.Debugf("attempting v1 ping for registry endpoint %s", e)
167 167
 
168 168
 	if e.String() == IndexServerAddress() {
169 169
 		// Skip the check, we know this one is valid
... ...
@@ -194,17 +194,17 @@ func (e *Endpoint) pingV1(factory *utils.HTTPRequestFactory) (RegistryInfo, erro
194 194
 		Standalone: true,
195 195
 	}
196 196
 	if err := json.Unmarshal(jsonString, &info); err != nil {
197
-		log.Debugf("Error unmarshalling the _ping RegistryInfo: %s", err)
197
+		logrus.Debugf("Error unmarshalling the _ping RegistryInfo: %s", err)
198 198
 		// don't stop here. Just assume sane defaults
199 199
 	}
200 200
 	if hdr := resp.Header.Get("X-Docker-Registry-Version"); hdr != "" {
201
-		log.Debugf("Registry version header: '%s'", hdr)
201
+		logrus.Debugf("Registry version header: '%s'", hdr)
202 202
 		info.Version = hdr
203 203
 	}
204
-	log.Debugf("RegistryInfo.Version: %q", info.Version)
204
+	logrus.Debugf("RegistryInfo.Version: %q", info.Version)
205 205
 
206 206
 	standalone := resp.Header.Get("X-Docker-Registry-Standalone")
207
-	log.Debugf("Registry standalone header: '%s'", standalone)
207
+	logrus.Debugf("Registry standalone header: '%s'", standalone)
208 208
 	// Accepted values are "true" (case-insensitive) and "1".
209 209
 	if strings.EqualFold(standalone, "true") || standalone == "1" {
210 210
 		info.Standalone = true
... ...
@@ -212,12 +212,12 @@ func (e *Endpoint) pingV1(factory *utils.HTTPRequestFactory) (RegistryInfo, erro
212 212
 		// there is a header set, and it is not "true" or "1", so assume fails
213 213
 		info.Standalone = false
214 214
 	}
215
-	log.Debugf("RegistryInfo.Standalone: %t", info.Standalone)
215
+	logrus.Debugf("RegistryInfo.Standalone: %t", info.Standalone)
216 216
 	return info, nil
217 217
 }
218 218
 
219 219
 func (e *Endpoint) pingV2(factory *utils.HTTPRequestFactory) (RegistryInfo, error) {
220
-	log.Debugf("attempting v2 ping for registry endpoint %s", e)
220
+	logrus.Debugf("attempting v2 ping for registry endpoint %s", e)
221 221
 
222 222
 	req, err := factory.NewRequest("GET", e.Path(""), nil)
223 223
 	if err != nil {
... ...
@@ -13,7 +13,7 @@ import (
13 13
 	"strings"
14 14
 	"time"
15 15
 
16
-	log "github.com/Sirupsen/logrus"
16
+	"github.com/Sirupsen/logrus"
17 17
 	"github.com/docker/docker/pkg/timeoutconn"
18 18
 )
19 19
 
... ...
@@ -100,7 +100,7 @@ func doRequest(req *http.Request, jar http.CookieJar, timeout TimeoutType, secur
100 100
 		}
101 101
 
102 102
 		hostDir := path.Join("/etc/docker/certs.d", req.URL.Host)
103
-		log.Debugf("hostDir: %s", hostDir)
103
+		logrus.Debugf("hostDir: %s", hostDir)
104 104
 		fs, err := ioutil.ReadDir(hostDir)
105 105
 		if err != nil && !os.IsNotExist(err) {
106 106
 			return nil, nil, err
... ...
@@ -111,7 +111,7 @@ func doRequest(req *http.Request, jar http.CookieJar, timeout TimeoutType, secur
111 111
 				if pool == nil {
112 112
 					pool = x509.NewCertPool()
113 113
 				}
114
-				log.Debugf("crt: %s", hostDir+"/"+f.Name())
114
+				logrus.Debugf("crt: %s", hostDir+"/"+f.Name())
115 115
 				data, err := ioutil.ReadFile(path.Join(hostDir, f.Name()))
116 116
 				if err != nil {
117 117
 					return nil, nil, err
... ...
@@ -121,7 +121,7 @@ func doRequest(req *http.Request, jar http.CookieJar, timeout TimeoutType, secur
121 121
 			if strings.HasSuffix(f.Name(), ".cert") {
122 122
 				certName := f.Name()
123 123
 				keyName := certName[:len(certName)-5] + ".key"
124
-				log.Debugf("cert: %s", hostDir+"/"+f.Name())
124
+				logrus.Debugf("cert: %s", hostDir+"/"+f.Name())
125 125
 				if !hasFile(fs, keyName) {
126 126
 					return nil, nil, fmt.Errorf("Missing key %s for certificate %s", keyName, certName)
127 127
 				}
... ...
@@ -134,7 +134,7 @@ func doRequest(req *http.Request, jar http.CookieJar, timeout TimeoutType, secur
134 134
 			if strings.HasSuffix(f.Name(), ".key") {
135 135
 				keyName := f.Name()
136 136
 				certName := keyName[:len(keyName)-4] + ".cert"
137
-				log.Debugf("key: %s", hostDir+"/"+f.Name())
137
+				logrus.Debugf("key: %s", hostDir+"/"+f.Name())
138 138
 				if !hasFile(fs, certName) {
139 139
 					return nil, nil, fmt.Errorf("Missing certificate %s for key %s", certName, keyName)
140 140
 				}
... ...
@@ -18,7 +18,7 @@ import (
18 18
 	"github.com/docker/docker/opts"
19 19
 	"github.com/gorilla/mux"
20 20
 
21
-	log "github.com/Sirupsen/logrus"
21
+	"github.com/Sirupsen/logrus"
22 22
 )
23 23
 
24 24
 var (
... ...
@@ -134,7 +134,7 @@ func init() {
134 134
 
135 135
 func handlerAccessLog(handler http.Handler) http.Handler {
136 136
 	logHandler := func(w http.ResponseWriter, r *http.Request) {
137
-		log.Debugf("%s \"%s %s\"", r.RemoteAddr, r.Method, r.URL)
137
+		logrus.Debugf("%s \"%s %s\"", r.RemoteAddr, r.Method, r.URL)
138 138
 		handler.ServeHTTP(w, r)
139 139
 	}
140 140
 	return http.HandlerFunc(logHandler)
... ...
@@ -467,7 +467,7 @@ func TestPing(t *testing.T) {
467 467
  * WARNING: Don't push on the repos uncommented, it'll block the tests
468 468
  *
469 469
 func TestWait(t *testing.T) {
470
-	log.Println("Test HTTP server ready and waiting:", testHttpServer.URL)
470
+	logrus.Println("Test HTTP server ready and waiting:", testHttpServer.URL)
471 471
 	c := make(chan int)
472 472
 	<-c
473 473
 }
... ...
@@ -3,7 +3,7 @@ package registry
3 3
 import (
4 4
 	"fmt"
5 5
 
6
-	log "github.com/Sirupsen/logrus"
6
+	"github.com/Sirupsen/logrus"
7 7
 	"github.com/docker/docker/engine"
8 8
 )
9 9
 
... ...
@@ -62,18 +62,18 @@ func (s *Service) Auth(job *engine.Job) error {
62 62
 	}
63 63
 
64 64
 	if endpoint, err = NewEndpoint(index); err != nil {
65
-		log.Errorf("unable to get new registry endpoint: %s", err)
65
+		logrus.Errorf("unable to get new registry endpoint: %s", err)
66 66
 		return err
67 67
 	}
68 68
 
69 69
 	authConfig.ServerAddress = endpoint.String()
70 70
 
71 71
 	if status, err = Login(authConfig, endpoint, HTTPRequestFactory(nil)); err != nil {
72
-		log.Errorf("unable to login against registry endpoint %s: %s", endpoint, err)
72
+		logrus.Errorf("unable to login against registry endpoint %s: %s", endpoint, err)
73 73
 		return err
74 74
 	}
75 75
 
76
-	log.Infof("successful registry login for endpoint %s: %s", endpoint, status)
76
+	logrus.Infof("successful registry login for endpoint %s: %s", endpoint, status)
77 77
 	job.Printf("%s\n", status)
78 78
 
79 79
 	return nil
... ...
@@ -17,7 +17,7 @@ import (
17 17
 	"strings"
18 18
 	"time"
19 19
 
20
-	log "github.com/Sirupsen/logrus"
20
+	"github.com/Sirupsen/logrus"
21 21
 	"github.com/docker/docker/pkg/httputils"
22 22
 	"github.com/docker/docker/pkg/tarsum"
23 23
 	"github.com/docker/docker/utils"
... ...
@@ -54,7 +54,7 @@ func NewSession(authConfig *AuthConfig, factory *utils.HTTPRequestFactory, endpo
54 54
 			return nil, err
55 55
 		}
56 56
 		if info.Standalone {
57
-			log.Debugf("Endpoint %s is eligible for private registry. Enabling decorator.", r.indexEndpoint.String())
57
+			logrus.Debugf("Endpoint %s is eligible for private registry. Enabling decorator.", r.indexEndpoint.String())
58 58
 			dec := utils.NewHTTPAuthDecorator(authConfig.Username, authConfig.Password)
59 59
 			factory.AddDecorator(dec)
60 60
 		}
... ...
@@ -93,7 +93,7 @@ func (r *Session) GetRemoteHistory(imgID, registry string, token []string) ([]st
93 93
 		return nil, fmt.Errorf("Error while reading the http response: %s", err)
94 94
 	}
95 95
 
96
-	log.Debugf("Ancestry: %s", jsonString)
96
+	logrus.Debugf("Ancestry: %s", jsonString)
97 97
 	history := new([]string)
98 98
 	if err := json.Unmarshal(jsonString, history); err != nil {
99 99
 		return nil, err
... ...
@@ -169,7 +169,7 @@ func (r *Session) GetRemoteImageLayer(imgID, registry string, token []string, im
169 169
 		statusCode = 0
170 170
 		res, client, err = r.doRequest(req)
171 171
 		if err != nil {
172
-			log.Debugf("Error contacting registry: %s", err)
172
+			logrus.Debugf("Error contacting registry: %s", err)
173 173
 			if res != nil {
174 174
 				if res.Body != nil {
175 175
 					res.Body.Close()
... ...
@@ -193,10 +193,10 @@ func (r *Session) GetRemoteImageLayer(imgID, registry string, token []string, im
193 193
 	}
194 194
 
195 195
 	if res.Header.Get("Accept-Ranges") == "bytes" && imgSize > 0 {
196
-		log.Debugf("server supports resume")
196
+		logrus.Debugf("server supports resume")
197 197
 		return httputils.ResumableRequestReaderWithInitialResponse(client, req, 5, imgSize, res), nil
198 198
 	}
199
-	log.Debugf("server doesn't support resume")
199
+	logrus.Debugf("server doesn't support resume")
200 200
 	return res.Body, nil
201 201
 }
202 202
 
... ...
@@ -219,7 +219,7 @@ func (r *Session) GetRemoteTags(registries []string, repository string, token []
219 219
 			return nil, err
220 220
 		}
221 221
 
222
-		log.Debugf("Got status code %d from %s", res.StatusCode, endpoint)
222
+		logrus.Debugf("Got status code %d from %s", res.StatusCode, endpoint)
223 223
 		defer res.Body.Close()
224 224
 
225 225
 		if res.StatusCode != 200 && res.StatusCode != 404 {
... ...
@@ -259,7 +259,7 @@ func buildEndpointsList(headers []string, indexEp string) ([]string, error) {
259 259
 func (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) {
260 260
 	repositoryTarget := fmt.Sprintf("%srepositories/%s/images", r.indexEndpoint.VersionString(1), remote)
261 261
 
262
-	log.Debugf("[registry] Calling GET %s", repositoryTarget)
262
+	logrus.Debugf("[registry] Calling GET %s", repositoryTarget)
263 263
 
264 264
 	req, err := r.reqFactory.NewRequest("GET", repositoryTarget, nil)
265 265
 	if err != nil {
... ...
@@ -285,7 +285,7 @@ func (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) {
285 285
 	} else if res.StatusCode != 200 {
286 286
 		errBody, err := ioutil.ReadAll(res.Body)
287 287
 		if err != nil {
288
-			log.Debugf("Error reading response body: %s", err)
288
+			logrus.Debugf("Error reading response body: %s", err)
289 289
 		}
290 290
 		return nil, utils.NewHTTPRequestError(fmt.Sprintf("Error: Status %d trying to pull repository %s: %q", res.StatusCode, remote, errBody), res)
291 291
 	}
... ...
@@ -326,7 +326,7 @@ func (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) {
326 326
 
327 327
 func (r *Session) PushImageChecksumRegistry(imgData *ImgData, registry string, token []string) error {
328 328
 
329
-	log.Debugf("[registry] Calling PUT %s", registry+"images/"+imgData.ID+"/checksum")
329
+	logrus.Debugf("[registry] Calling PUT %s", registry+"images/"+imgData.ID+"/checksum")
330 330
 
331 331
 	req, err := r.reqFactory.NewRequest("PUT", registry+"images/"+imgData.ID+"/checksum", nil)
332 332
 	if err != nil {
... ...
@@ -363,7 +363,7 @@ func (r *Session) PushImageChecksumRegistry(imgData *ImgData, registry string, t
363 363
 // Push a local image to the registry
364 364
 func (r *Session) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, registry string, token []string) error {
365 365
 
366
-	log.Debugf("[registry] Calling PUT %s", registry+"images/"+imgData.ID+"/json")
366
+	logrus.Debugf("[registry] Calling PUT %s", registry+"images/"+imgData.ID+"/json")
367 367
 
368 368
 	req, err := r.reqFactory.NewRequest("PUT", registry+"images/"+imgData.ID+"/json", bytes.NewReader(jsonRaw))
369 369
 	if err != nil {
... ...
@@ -398,7 +398,7 @@ func (r *Session) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, regist
398 398
 
399 399
 func (r *Session) PushImageLayerRegistry(imgID string, layer io.Reader, registry string, token []string, jsonRaw []byte) (checksum string, checksumPayload string, err error) {
400 400
 
401
-	log.Debugf("[registry] Calling PUT %s", registry+"images/"+imgID+"/layer")
401
+	logrus.Debugf("[registry] Calling PUT %s", registry+"images/"+imgID+"/layer")
402 402
 
403 403
 	tarsumLayer, err := tarsum.NewTarSum(layer, false, tarsum.Version0)
404 404
 	if err != nil {
... ...
@@ -486,8 +486,8 @@ func (r *Session) PushImageJSONIndex(remote string, imgList []*ImgData, validate
486 486
 		suffix = "images"
487 487
 	}
488 488
 	u := fmt.Sprintf("%srepositories/%s/%s", r.indexEndpoint.VersionString(1), remote, suffix)
489
-	log.Debugf("[registry] PUT %s", u)
490
-	log.Debugf("Image list pushed to index:\n%s", imgListJSON)
489
+	logrus.Debugf("[registry] PUT %s", u)
490
+	logrus.Debugf("Image list pushed to index:\n%s", imgListJSON)
491 491
 	headers := map[string][]string{
492 492
 		"Content-type":   {"application/json"},
493 493
 		"X-Docker-Token": {"true"},
... ...
@@ -507,7 +507,7 @@ func (r *Session) PushImageJSONIndex(remote string, imgList []*ImgData, validate
507 507
 		}
508 508
 		res.Body.Close()
509 509
 		u = res.Header.Get("Location")
510
-		log.Debugf("Redirected to %s", u)
510
+		logrus.Debugf("Redirected to %s", u)
511 511
 	}
512 512
 	defer res.Body.Close()
513 513
 
... ...
@@ -520,13 +520,13 @@ func (r *Session) PushImageJSONIndex(remote string, imgList []*ImgData, validate
520 520
 		if res.StatusCode != 200 && res.StatusCode != 201 {
521 521
 			errBody, err := ioutil.ReadAll(res.Body)
522 522
 			if err != nil {
523
-				log.Debugf("Error reading response body: %s", err)
523
+				logrus.Debugf("Error reading response body: %s", err)
524 524
 			}
525 525
 			return nil, utils.NewHTTPRequestError(fmt.Sprintf("Error: Status %d trying to push repository %s: %q", res.StatusCode, remote, errBody), res)
526 526
 		}
527 527
 		if res.Header.Get("X-Docker-Token") != "" {
528 528
 			tokens = res.Header["X-Docker-Token"]
529
-			log.Debugf("Auth token: %v", tokens)
529
+			logrus.Debugf("Auth token: %v", tokens)
530 530
 		} else {
531 531
 			return nil, fmt.Errorf("Index response didn't contain an access token")
532 532
 		}
... ...
@@ -544,7 +544,7 @@ func (r *Session) PushImageJSONIndex(remote string, imgList []*ImgData, validate
544 544
 		if res.StatusCode != 204 {
545 545
 			errBody, err := ioutil.ReadAll(res.Body)
546 546
 			if err != nil {
547
-				log.Debugf("Error reading response body: %s", err)
547
+				logrus.Debugf("Error reading response body: %s", err)
548 548
 			}
549 549
 			return nil, utils.NewHTTPRequestError(fmt.Sprintf("Error: Status %d trying to push checksums %s: %q", res.StatusCode, remote, errBody), res)
550 550
 		}
... ...
@@ -578,7 +578,7 @@ func shouldRedirect(response *http.Response) bool {
578 578
 }
579 579
 
580 580
 func (r *Session) SearchRepositories(term string) (*SearchResults, error) {
581
-	log.Debugf("Index server: %s", r.indexEndpoint)
581
+	logrus.Debugf("Index server: %s", r.indexEndpoint)
582 582
 	u := r.indexEndpoint.VersionString(1) + "search?q=" + url.QueryEscape(term)
583 583
 	req, err := r.reqFactory.NewRequest("GET", u, nil)
584 584
 	if err != nil {
... ...
@@ -9,7 +9,7 @@ import (
9 9
 	"net/http"
10 10
 	"strconv"
11 11
 
12
-	log "github.com/Sirupsen/logrus"
12
+	"github.com/Sirupsen/logrus"
13 13
 	"github.com/docker/distribution/digest"
14 14
 	"github.com/docker/docker/registry/v2"
15 15
 	"github.com/docker/docker/utils"
... ...
@@ -57,7 +57,7 @@ func (r *Session) GetV2Authorization(ep *Endpoint, imageName string, readOnly bo
57 57
 		scopes = append(scopes, "push")
58 58
 	}
59 59
 
60
-	log.Debugf("Getting authorization for %s %s", imageName, scopes)
60
+	logrus.Debugf("Getting authorization for %s %s", imageName, scopes)
61 61
 	return NewRequestAuthorization(r.GetAuthConfig(true), ep, "repository", imageName, scopes), nil
62 62
 }
63 63
 
... ...
@@ -75,7 +75,7 @@ func (r *Session) GetV2ImageManifest(ep *Endpoint, imageName, tagName string, au
75 75
 	}
76 76
 
77 77
 	method := "GET"
78
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
78
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
79 79
 
80 80
 	req, err := r.reqFactory.NewRequest(method, routeURL, nil)
81 81
 	if err != nil {
... ...
@@ -116,7 +116,7 @@ func (r *Session) HeadV2ImageBlob(ep *Endpoint, imageName, sumType, sum string,
116 116
 	}
117 117
 
118 118
 	method := "HEAD"
119
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
119
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
120 120
 
121 121
 	req, err := r.reqFactory.NewRequest(method, routeURL, nil)
122 122
 	if err != nil {
... ...
@@ -151,7 +151,7 @@ func (r *Session) GetV2ImageBlob(ep *Endpoint, imageName, sumType, sum string, b
151 151
 	}
152 152
 
153 153
 	method := "GET"
154
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
154
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
155 155
 	req, err := r.reqFactory.NewRequest(method, routeURL, nil)
156 156
 	if err != nil {
157 157
 		return err
... ...
@@ -182,7 +182,7 @@ func (r *Session) GetV2ImageBlobReader(ep *Endpoint, imageName, sumType, sum str
182 182
 	}
183 183
 
184 184
 	method := "GET"
185
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
185
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
186 186
 	req, err := r.reqFactory.NewRequest(method, routeURL, nil)
187 187
 	if err != nil {
188 188
 		return nil, 0, err
... ...
@@ -219,7 +219,7 @@ func (r *Session) PutV2ImageBlob(ep *Endpoint, imageName, sumType, sumStr string
219 219
 	}
220 220
 
221 221
 	method := "PUT"
222
-	log.Debugf("[registry] Calling %q %s", method, location)
222
+	logrus.Debugf("[registry] Calling %q %s", method, location)
223 223
 	req, err := r.reqFactory.NewRequest(method, location, ioutil.NopCloser(blobRdr))
224 224
 	if err != nil {
225 225
 		return err
... ...
@@ -244,7 +244,7 @@ func (r *Session) PutV2ImageBlob(ep *Endpoint, imageName, sumType, sumStr string
244 244
 		if err != nil {
245 245
 			return err
246 246
 		}
247
-		log.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
247
+		logrus.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
248 248
 		return utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d trying to push %s blob - %s:%s", res.StatusCode, imageName, sumType, sumStr), res)
249 249
 	}
250 250
 
... ...
@@ -258,7 +258,7 @@ func (r *Session) initiateBlobUpload(ep *Endpoint, imageName string, auth *Reque
258 258
 		return "", err
259 259
 	}
260 260
 
261
-	log.Debugf("[registry] Calling %q %s", "POST", routeURL)
261
+	logrus.Debugf("[registry] Calling %q %s", "POST", routeURL)
262 262
 	req, err := r.reqFactory.NewRequest("POST", routeURL, nil)
263 263
 	if err != nil {
264 264
 		return "", err
... ...
@@ -285,7 +285,7 @@ func (r *Session) initiateBlobUpload(ep *Endpoint, imageName string, auth *Reque
285 285
 			return "", err
286 286
 		}
287 287
 
288
-		log.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
288
+		logrus.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
289 289
 		return "", utils.NewHTTPRequestError(fmt.Sprintf("Server error: unexpected %d response status trying to initiate upload of %s", res.StatusCode, imageName), res)
290 290
 	}
291 291
 
... ...
@@ -304,7 +304,7 @@ func (r *Session) PutV2ImageManifest(ep *Endpoint, imageName, tagName string, si
304 304
 	}
305 305
 
306 306
 	method := "PUT"
307
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
307
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
308 308
 	req, err := r.reqFactory.NewRequest(method, routeURL, bytes.NewReader(signedManifest))
309 309
 	if err != nil {
310 310
 		return "", err
... ...
@@ -327,7 +327,7 @@ func (r *Session) PutV2ImageManifest(ep *Endpoint, imageName, tagName string, si
327 327
 		if err != nil {
328 328
 			return "", err
329 329
 		}
330
-		log.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
330
+		logrus.Debugf("Unexpected response from server: %q %#v", errBody, res.Header)
331 331
 		return "", utils.NewHTTPRequestError(fmt.Sprintf("Server error: %d trying to push %s:%s manifest", res.StatusCode, imageName, tagName), res)
332 332
 	}
333 333
 
... ...
@@ -364,7 +364,7 @@ func (r *Session) GetV2RemoteTags(ep *Endpoint, imageName string, auth *RequestA
364 364
 	}
365 365
 
366 366
 	method := "GET"
367
-	log.Debugf("[registry] Calling %q %s", method, routeURL)
367
+	logrus.Debugf("[registry] Calling %q %s", method, routeURL)
368 368
 
369 369
 	req, err := r.reqFactory.NewRequest(method, routeURL, nil)
370 370
 	if err != nil {
... ...
@@ -3,7 +3,7 @@ package runconfig
3 3
 import (
4 4
 	"strings"
5 5
 
6
-	log "github.com/Sirupsen/logrus"
6
+	"github.com/Sirupsen/logrus"
7 7
 	"github.com/docker/docker/nat"
8 8
 )
9 9
 
... ...
@@ -50,7 +50,7 @@ func Merge(userConf, imageConf *Config) error {
50 50
 	}
51 51
 	if len(imageConf.PortSpecs) > 0 {
52 52
 		// FIXME: I think we can safely remove this. Leaving it for now for the sake of reverse-compat paranoia.
53
-		log.Debugf("Migrating image port specs to containter: %s", strings.Join(imageConf.PortSpecs, ", "))
53
+		logrus.Debugf("Migrating image port specs to containter: %s", strings.Join(imageConf.PortSpecs, ", "))
54 54
 		if userConf.ExposedPorts == nil {
55 55
 			userConf.ExposedPorts = make(nat.PortSet)
56 56
 		}
... ...
@@ -4,7 +4,7 @@ import (
4 4
 	"fmt"
5 5
 	"time"
6 6
 
7
-	log "github.com/Sirupsen/logrus"
7
+	"github.com/Sirupsen/logrus"
8 8
 	"github.com/docker/docker/engine"
9 9
 	"github.com/docker/libtrust"
10 10
 )
... ...
@@ -56,7 +56,7 @@ func (t *TrustStore) CmdCheckKey(job *engine.Job) error {
56 56
 		return fmt.Errorf("Error verifying key to namespace: %s", namespace)
57 57
 	}
58 58
 	if !verified {
59
-		log.Debugf("Verification failed for %s using key %s", namespace, pk.KeyID())
59
+		logrus.Debugf("Verification failed for %s using key %s", namespace, pk.KeyID())
60 60
 		job.Stdout.Write([]byte("not verified"))
61 61
 	} else if t.expiration.Before(time.Now()) {
62 62
 		job.Stdout.Write([]byte("expired"))
... ...
@@ -12,7 +12,7 @@ import (
12 12
 	"sync"
13 13
 	"time"
14 14
 
15
-	log "github.com/Sirupsen/logrus"
15
+	"github.com/Sirupsen/logrus"
16 16
 	"github.com/docker/libtrust/trustgraph"
17 17
 )
18 18
 
... ...
@@ -93,7 +93,7 @@ func (t *TrustStore) reload() error {
93 93
 	}
94 94
 	if len(statements) == 0 {
95 95
 		if t.autofetch {
96
-			log.Debugf("No grants, fetching")
96
+			logrus.Debugf("No grants, fetching")
97 97
 			t.fetcher = time.AfterFunc(t.fetchTime, t.fetch)
98 98
 		}
99 99
 		return nil
... ...
@@ -106,7 +106,7 @@ func (t *TrustStore) reload() error {
106 106
 
107 107
 	t.expiration = expiration
108 108
 	t.graph = trustgraph.NewMemoryGraph(grants)
109
-	log.Debugf("Reloaded graph with %d grants expiring at %s", len(grants), expiration)
109
+	logrus.Debugf("Reloaded graph with %d grants expiring at %s", len(grants), expiration)
110 110
 
111 111
 	if t.autofetch {
112 112
 		nextFetch := expiration.Sub(time.Now())
... ...
@@ -161,28 +161,28 @@ func (t *TrustStore) fetch() {
161 161
 	for bg, ep := range t.baseEndpoints {
162 162
 		statement, err := t.fetchBaseGraph(ep)
163 163
 		if err != nil {
164
-			log.Infof("Trust graph fetch failed: %s", err)
164
+			logrus.Infof("Trust graph fetch failed: %s", err)
165 165
 			continue
166 166
 		}
167 167
 		b, err := statement.Bytes()
168 168
 		if err != nil {
169
-			log.Infof("Bad trust graph statement: %s", err)
169
+			logrus.Infof("Bad trust graph statement: %s", err)
170 170
 			continue
171 171
 		}
172 172
 		// TODO check if value differs
173 173
 		err = ioutil.WriteFile(path.Join(t.path, bg+".json"), b, 0600)
174 174
 		if err != nil {
175
-			log.Infof("Error writing trust graph statement: %s", err)
175
+			logrus.Infof("Error writing trust graph statement: %s", err)
176 176
 		}
177 177
 		fetchCount++
178 178
 	}
179
-	log.Debugf("Fetched %d base graphs at %s", fetchCount, time.Now())
179
+	logrus.Debugf("Fetched %d base graphs at %s", fetchCount, time.Now())
180 180
 
181 181
 	if fetchCount > 0 {
182 182
 		go func() {
183 183
 			err := t.reload()
184 184
 			if err != nil {
185
-				log.Infof("Reload of trust graph failed: %s", err)
185
+				logrus.Infof("Reload of trust graph failed: %s", err)
186 186
 			}
187 187
 		}()
188 188
 		t.fetchTime = defaultFetchtime
... ...
@@ -5,7 +5,7 @@ import (
5 5
 	"net/http"
6 6
 	"strings"
7 7
 
8
-	log "github.com/Sirupsen/logrus"
8
+	"github.com/Sirupsen/logrus"
9 9
 )
10 10
 
11 11
 // VersionInfo is used to model entities which has a version.
... ...
@@ -163,6 +163,6 @@ func (h *HTTPRequestFactory) NewRequest(method, urlStr string, body io.Reader, d
163 163
 			return nil, err
164 164
 		}
165 165
 	}
166
-	log.Debugf("%v -- HEADERS: %v", req.URL, req.Header)
166
+	logrus.Debugf("%v -- HEADERS: %v", req.URL, req.Header)
167 167
 	return req, err
168 168
 }
... ...
@@ -18,7 +18,7 @@ import (
18 18
 	"strings"
19 19
 	"sync"
20 20
 
21
-	log "github.com/Sirupsen/logrus"
21
+	"github.com/Sirupsen/logrus"
22 22
 	"github.com/docker/docker/autogen/dockerversion"
23 23
 	"github.com/docker/docker/pkg/archive"
24 24
 	"github.com/docker/docker/pkg/fileutils"
... ...
@@ -157,7 +157,7 @@ func DockerInitPath(localCopy string) string {
157 157
 
158 158
 func GetTotalUsedFds() int {
159 159
 	if fds, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil {
160
-		log.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err)
160
+		logrus.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err)
161 161
 	} else {
162 162
 		return len(fds)
163 163
 	}
... ...
@@ -7,7 +7,7 @@ import (
7 7
 	"path/filepath"
8 8
 	"sync"
9 9
 
10
-	log "github.com/Sirupsen/logrus"
10
+	"github.com/Sirupsen/logrus"
11 11
 	"github.com/docker/docker/daemon/graphdriver"
12 12
 	"github.com/docker/docker/pkg/stringid"
13 13
 )
... ...
@@ -95,16 +95,16 @@ func (r *Repository) restore() error {
95 95
 		}
96 96
 		if err := vol.FromDisk(); err != nil {
97 97
 			if !os.IsNotExist(err) {
98
-				log.Debugf("Error restoring volume: %v", err)
98
+				logrus.Debugf("Error restoring volume: %v", err)
99 99
 				continue
100 100
 			}
101 101
 			if err := vol.initialize(); err != nil {
102
-				log.Debugf("%s", err)
102
+				logrus.Debugf("%s", err)
103 103
 				continue
104 104
 			}
105 105
 		}
106 106
 		if err := r.add(vol); err != nil {
107
-			log.Debugf("Error restoring volume: %v", err)
107
+			logrus.Debugf("Error restoring volume: %v", err)
108 108
 		}
109 109
 	}
110 110
 	return nil