Browse Source

Use logrus everywhere for logging

Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Alexandr Morozov 10 years ago
parent
commit
7c62cee51e
61 changed files with 111 additions and 79 deletions
  1. 1 1
      api/client/commands.go
  2. 1 1
      api/client/hijack.go
  3. 1 1
      api/client/utils.go
  4. 1 1
      api/common.go
  5. 1 1
      api/server/server.go
  6. 1 1
      builder/dispatchers.go
  7. 1 1
      builder/evaluator.go
  8. 1 1
      builder/internals.go
  9. 1 1
      daemon/attach.go
  10. 1 1
      daemon/container.go
  11. 4 3
      daemon/daemon.go
  12. 1 1
      daemon/daemon_aufs.go
  13. 1 1
      daemon/delete.go
  14. 1 1
      daemon/exec.go
  15. 1 1
      daemon/execdriver/lxc/driver.go
  16. 1 1
      daemon/graphdriver/aufs/aufs.go
  17. 1 1
      daemon/graphdriver/aufs/mount.go
  18. 1 1
      daemon/graphdriver/devmapper/attach_loopback.go
  19. 1 1
      daemon/graphdriver/devmapper/deviceset.go
  20. 1 1
      daemon/graphdriver/devmapper/devmapper.go
  21. 1 1
      daemon/graphdriver/devmapper/driver.go
  22. 1 1
      daemon/graphdriver/fsdiff.go
  23. 1 1
      daemon/info.go
  24. 1 1
      daemon/logs.go
  25. 1 1
      daemon/monitor.go
  26. 1 1
      daemon/networkdriver/bridge/driver.go
  27. 1 1
      daemon/networkdriver/portmapper/mapper.go
  28. 1 1
      daemon/volumes.go
  29. 1 1
      docker/daemon.go
  30. 3 0
      docker/docker.go
  31. 16 0
      docker/log.go
  32. 1 1
      graph/export.go
  33. 1 1
      graph/graph.go
  34. 1 1
      graph/load.go
  35. 1 1
      graph/pull.go
  36. 1 1
      graph/push.go
  37. 1 1
      graph/service.go
  38. 1 1
      image/image.go
  39. 1 1
      integration/commands_test.go
  40. 1 1
      integration/runtime_test.go
  41. 23 20
      integration/utils_test.go
  42. 1 1
      pkg/archive/archive.go
  43. 1 1
      pkg/archive/changes.go
  44. 1 1
      pkg/broadcastwriter/broadcastwriter.go
  45. 1 1
      pkg/fileutils/fileutils.go
  46. 1 1
      pkg/httputils/resumablerequestreader.go
  47. 1 1
      pkg/iptables/iptables.go
  48. 9 0
      pkg/log/log.go
  49. 1 1
      pkg/signal/trap.go
  50. 1 1
      pkg/stdcopy/stdcopy.go
  51. 1 1
      pkg/tarsum/tarsum.go
  52. 1 1
      registry/endpoint.go
  53. 1 1
      registry/registry_mock_test.go
  54. 1 1
      registry/session.go
  55. 1 1
      registry/session_v2.go
  56. 1 1
      runconfig/merge.go
  57. 1 1
      trust/service.go
  58. 1 1
      trust/trusts.go
  59. 1 1
      utils/http.go
  60. 1 1
      utils/utils.go
  61. 1 1
      volumes/repository.go

+ 1 - 1
api/client/commands.go

@@ -22,6 +22,7 @@ import (
 	"text/template"
 	"time"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/engine"
@@ -29,7 +30,6 @@ import (
 	"github.com/docker/docker/nat"
 	"github.com/docker/docker/opts"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
 	flag "github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/parsers/filters"

+ 1 - 1
api/client/hijack.go

@@ -11,9 +11,9 @@ import (
 	"runtime"
 	"strings"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/dockerversion"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/promise"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/docker/docker/pkg/term"

+ 1 - 1
api/client/utils.go

@@ -16,10 +16,10 @@ import (
 	"strings"
 	"syscall"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/docker/docker/pkg/term"
 	"github.com/docker/docker/registry"

+ 1 - 1
api/common.go

@@ -5,8 +5,8 @@ import (
 	"mime"
 	"strings"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/version"
 )

+ 1 - 1
api/server/server.go

@@ -23,10 +23,10 @@ import (
 	"github.com/docker/libcontainer/user"
 	"github.com/gorilla/mux"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/listenbuffer"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/docker/docker/pkg/systemd"

+ 1 - 1
builder/dispatchers.go

@@ -14,8 +14,8 @@ import (
 	"regexp"
 	"strings"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/nat"
-	"github.com/docker/docker/pkg/log"
 	flag "github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/runconfig"
 )

+ 1 - 1
builder/evaluator.go

@@ -27,10 +27,10 @@ import (
 	"path"
 	"strings"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/builder/parser"
 	"github.com/docker/docker/daemon"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/tarsum"
 	"github.com/docker/docker/registry"
 	"github.com/docker/docker/runconfig"

+ 1 - 1
builder/internals.go

@@ -18,11 +18,11 @@ import (
 	"syscall"
 	"time"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/builder/parser"
 	"github.com/docker/docker/daemon"
 	imagepkg "github.com/docker/docker/image"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/symlink"
 	"github.com/docker/docker/pkg/system"

+ 1 - 1
daemon/attach.go

@@ -9,7 +9,7 @@ import (
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/ioutils"
 	"github.com/docker/docker/pkg/jsonlog"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/promise"
 	"github.com/docker/docker/utils"
 )

+ 1 - 1
daemon/container.go

@@ -25,7 +25,7 @@ import (
 	"github.com/docker/docker/pkg/archive"
 	"github.com/docker/docker/pkg/broadcastwriter"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/networkfs/etchosts"
 	"github.com/docker/docker/pkg/networkfs/resolvconf"
 	"github.com/docker/docker/pkg/promise"

+ 4 - 3
daemon/daemon.go

@@ -14,6 +14,7 @@ import (
 
 	"github.com/docker/libcontainer/label"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/daemon/execdriver"
 	"github.com/docker/docker/daemon/execdriver/execdrivers"
 	"github.com/docker/docker/daemon/execdriver/lxc"
@@ -29,7 +30,6 @@ import (
 	"github.com/docker/docker/pkg/broadcastwriter"
 	"github.com/docker/docker/pkg/graphdb"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
 	"github.com/docker/docker/pkg/namesgenerator"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/parsers/kernel"
@@ -304,7 +304,7 @@ func (daemon *Daemon) restore() error {
 	)
 
 	if !debug {
-		log.Infof("Loading containers: ")
+		log.Infof("Loading containers: start.")
 	}
 	dir, err := ioutil.ReadDir(daemon.repository)
 	if err != nil {
@@ -392,7 +392,8 @@ func (daemon *Daemon) restore() error {
 	}
 
 	if !debug {
-		log.Infof(": done.")
+		fmt.Println()
+		log.Infof("Loading containers: done.")
 	}
 
 	return nil

+ 1 - 1
daemon/daemon_aufs.go

@@ -6,7 +6,7 @@ import (
 	"github.com/docker/docker/daemon/graphdriver"
 	"github.com/docker/docker/daemon/graphdriver/aufs"
 	"github.com/docker/docker/graph"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // Given the graphdriver ad, if it is aufs, then migrate it.

+ 1 - 1
daemon/delete.go

@@ -6,7 +6,7 @@ import (
 	"path"
 
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 func (daemon *Daemon) ContainerRm(job *engine.Job) engine.Status {

+ 1 - 1
daemon/exec.go

@@ -14,7 +14,7 @@ import (
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/broadcastwriter"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/promise"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/utils"

+ 1 - 1
daemon/execdriver/lxc/driver.go

@@ -18,7 +18,7 @@ import (
 	"github.com/kr/pty"
 
 	"github.com/docker/docker/daemon/execdriver"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/term"
 	"github.com/docker/docker/utils"
 	"github.com/docker/libcontainer/cgroups"

+ 1 - 1
daemon/graphdriver/aufs/aufs.go

@@ -32,7 +32,7 @@ import (
 
 	"github.com/docker/docker/daemon/graphdriver"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	mountpk "github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/utils"
 	"github.com/docker/libcontainer/label"

+ 1 - 1
daemon/graphdriver/aufs/mount.go

@@ -4,7 +4,7 @@ import (
 	"os/exec"
 	"syscall"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 func Unmount(target string) error {

+ 1 - 1
daemon/graphdriver/devmapper/attach_loopback.go

@@ -7,7 +7,7 @@ import (
 	"os"
 	"syscall"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 func stringToLoopName(src string) [LoNameSize]uint8 {

+ 1 - 1
daemon/graphdriver/devmapper/deviceset.go

@@ -19,7 +19,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/daemon/graphdriver"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/units"
 	"github.com/docker/libcontainer/label"

+ 1 - 1
daemon/graphdriver/devmapper/devmapper.go

@@ -9,7 +9,7 @@ import (
 	"runtime"
 	"syscall"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 type DevmapperLogger interface {

+ 1 - 1
daemon/graphdriver/devmapper/driver.go

@@ -9,7 +9,7 @@ import (
 	"path"
 
 	"github.com/docker/docker/daemon/graphdriver"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/pkg/units"
 )

+ 1 - 1
daemon/graphdriver/fsdiff.go

@@ -6,7 +6,7 @@ import (
 
 	"github.com/docker/docker/pkg/archive"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/utils"
 )
 

+ 1 - 1
daemon/info.go

@@ -6,7 +6,7 @@ import (
 
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/parsers/kernel"
 	"github.com/docker/docker/pkg/parsers/operatingsystem"
 	"github.com/docker/docker/registry"

+ 1 - 1
daemon/logs.go

@@ -10,7 +10,7 @@ import (
 
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/jsonlog"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/tailfile"
 	"github.com/docker/docker/pkg/timeutils"
 )

+ 1 - 1
daemon/monitor.go

@@ -7,7 +7,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/daemon/execdriver"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/runconfig"
 )
 

+ 1 - 1
daemon/networkdriver/bridge/driver.go

@@ -14,7 +14,7 @@ import (
 	"github.com/docker/docker/daemon/networkdriver/portmapper"
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/iptables"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/networkfs/resolvconf"
 	"github.com/docker/docker/pkg/parsers/kernel"
 	"github.com/docker/libcontainer/netlink"

+ 1 - 1
daemon/networkdriver/portmapper/mapper.go

@@ -8,7 +8,7 @@ import (
 
 	"github.com/docker/docker/daemon/networkdriver/portallocator"
 	"github.com/docker/docker/pkg/iptables"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 type mapping struct {

+ 1 - 1
daemon/volumes.go

@@ -12,7 +12,7 @@ import (
 
 	"github.com/docker/docker/daemon/execdriver"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/symlink"
 	"github.com/docker/docker/volumes"
 )

+ 1 - 1
docker/daemon.go

@@ -3,6 +3,7 @@
 package main
 
 import (
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/builder"
 	"github.com/docker/docker/builtins"
 	"github.com/docker/docker/daemon"
@@ -10,7 +11,6 @@ import (
 	_ "github.com/docker/docker/daemon/execdriver/native"
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
 	flag "github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/pkg/signal"
 )

+ 3 - 0
docker/docker.go

@@ -28,6 +28,7 @@ func main() {
 	if reexec.Init() {
 		return
 	}
+
 	flag.Parse()
 	// FIXME: validate daemon flags here
 
@@ -39,6 +40,8 @@ func main() {
 		os.Setenv("DEBUG", "1")
 	}
 
+	initLogging(*flDebug)
+
 	if len(flHosts) == 0 {
 		defaultHost := os.Getenv("DOCKER_HOST")
 		if defaultHost == "" || *flDaemon {

+ 16 - 0
docker/log.go

@@ -0,0 +1,16 @@
+package main
+
+import (
+	"os"
+
+	log "github.com/Sirupsen/logrus"
+)
+
+func initLogging(debug bool) {
+	log.SetOutput(os.Stderr)
+	if debug {
+		log.SetLevel(log.DebugLevel)
+	} else {
+		log.SetLevel(log.InfoLevel)
+	}
+}

+ 1 - 1
graph/export.go

@@ -9,7 +9,7 @@ import (
 
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/parsers"
 )
 

+ 1 - 1
graph/graph.go

@@ -16,7 +16,7 @@ import (
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/image"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/truncindex"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/utils"

+ 1 - 1
graph/load.go

@@ -10,7 +10,7 @@ import (
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/image"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // Loads a set of images into the repository. This is the complementary of ImageExport.

+ 1 - 1
graph/pull.go

@@ -14,7 +14,7 @@ import (
 
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/image"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/registry"
 	"github.com/docker/docker/utils"
 	"github.com/docker/libtrust"

+ 1 - 1
graph/push.go

@@ -9,7 +9,7 @@ import (
 
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/registry"
 	"github.com/docker/docker/utils"
 )

+ 1 - 1
graph/service.go

@@ -6,7 +6,7 @@ import (
 
 	"github.com/docker/docker/engine"
 	"github.com/docker/docker/image"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 func (s *TagStore) Install(eng *engine.Engine) error {

+ 1 - 1
image/image.go

@@ -10,7 +10,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/pkg/archive"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/utils"
 )

+ 1 - 1
integration/commands_test.go

@@ -11,7 +11,7 @@ import (
 
 	"github.com/docker/docker/api/client"
 	"github.com/docker/docker/daemon"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/term"
 	"github.com/docker/docker/utils"
 	"github.com/docker/libtrust"

+ 1 - 1
integration/runtime_test.go

@@ -21,7 +21,7 @@ import (
 	"github.com/docker/docker/image"
 	"github.com/docker/docker/nat"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/reexec"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/utils"

+ 23 - 20
integration/utils_test.go

@@ -18,20 +18,23 @@ import (
 	"github.com/docker/docker/builtins"
 	"github.com/docker/docker/daemon"
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
 	flag "github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/pkg/sysinfo"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/utils"
 )
 
+type Fataler interface {
+	Fatal(...interface{})
+}
+
 // This file contains utility functions for docker's unit test suite.
 // It has to be named XXX_test.go, apparently, in other to access private functions
 // from other XXX_test.go functions.
 
 // Create a temporary daemon suitable for unit testing.
 // Call t.Fatal() at the first error.
-func mkDaemon(f log.Fataler) *daemon.Daemon {
+func mkDaemon(f Fataler) *daemon.Daemon {
 	eng := newTestEngine(f, false, "")
 	return mkDaemonFromEngine(eng, f)
 	// FIXME:
@@ -40,7 +43,7 @@ func mkDaemon(f log.Fataler) *daemon.Daemon {
 	// [...]
 }
 
-func createNamedTestContainer(eng *engine.Engine, config *runconfig.Config, f log.Fataler, name string) (shortId string) {
+func createNamedTestContainer(eng *engine.Engine, config *runconfig.Config, f Fataler, name string) (shortId string) {
 	job := eng.Job("create", name)
 	if err := job.ImportEnv(config); err != nil {
 		f.Fatal(err)
@@ -53,23 +56,23 @@ func createNamedTestContainer(eng *engine.Engine, config *runconfig.Config, f lo
 	return engine.Tail(outputBuffer, 1)
 }
 
-func createTestContainer(eng *engine.Engine, config *runconfig.Config, f log.Fataler) (shortId string) {
+func createTestContainer(eng *engine.Engine, config *runconfig.Config, f Fataler) (shortId string) {
 	return createNamedTestContainer(eng, config, f, "")
 }
 
-func startContainer(eng *engine.Engine, id string, t log.Fataler) {
+func startContainer(eng *engine.Engine, id string, t Fataler) {
 	job := eng.Job("start", id)
 	if err := job.Run(); err != nil {
 		t.Fatal(err)
 	}
 }
 
-func containerRun(eng *engine.Engine, id string, t log.Fataler) {
+func containerRun(eng *engine.Engine, id string, t Fataler) {
 	startContainer(eng, id, t)
 	containerWait(eng, id, t)
 }
 
-func containerFileExists(eng *engine.Engine, id, dir string, t log.Fataler) bool {
+func containerFileExists(eng *engine.Engine, id, dir string, t Fataler) bool {
 	c := getContainer(eng, id, t)
 	if err := c.Mount(); err != nil {
 		t.Fatal(err)
@@ -84,7 +87,7 @@ func containerFileExists(eng *engine.Engine, id, dir string, t log.Fataler) bool
 	return true
 }
 
-func containerAttach(eng *engine.Engine, id string, t log.Fataler) (io.WriteCloser, io.ReadCloser) {
+func containerAttach(eng *engine.Engine, id string, t Fataler) (io.WriteCloser, io.ReadCloser) {
 	c := getContainer(eng, id, t)
 	i, err := c.StdinPipe()
 	if err != nil {
@@ -97,31 +100,31 @@ func containerAttach(eng *engine.Engine, id string, t log.Fataler) (io.WriteClos
 	return i, o
 }
 
-func containerWait(eng *engine.Engine, id string, t log.Fataler) int {
+func containerWait(eng *engine.Engine, id string, t Fataler) int {
 	ex, _ := getContainer(eng, id, t).WaitStop(-1 * time.Second)
 	return ex
 }
 
-func containerWaitTimeout(eng *engine.Engine, id string, t log.Fataler) error {
+func containerWaitTimeout(eng *engine.Engine, id string, t Fataler) error {
 	_, err := getContainer(eng, id, t).WaitStop(500 * time.Millisecond)
 	return err
 }
 
-func containerKill(eng *engine.Engine, id string, t log.Fataler) {
+func containerKill(eng *engine.Engine, id string, t Fataler) {
 	if err := eng.Job("kill", id).Run(); err != nil {
 		t.Fatal(err)
 	}
 }
 
-func containerRunning(eng *engine.Engine, id string, t log.Fataler) bool {
+func containerRunning(eng *engine.Engine, id string, t Fataler) bool {
 	return getContainer(eng, id, t).IsRunning()
 }
 
-func containerAssertExists(eng *engine.Engine, id string, t log.Fataler) {
+func containerAssertExists(eng *engine.Engine, id string, t Fataler) {
 	getContainer(eng, id, t)
 }
 
-func containerAssertNotExists(eng *engine.Engine, id string, t log.Fataler) {
+func containerAssertNotExists(eng *engine.Engine, id string, t Fataler) {
 	daemon := mkDaemonFromEngine(eng, t)
 	if c := daemon.Get(id); c != nil {
 		t.Fatal(fmt.Errorf("Container %s should not exist", id))
@@ -130,7 +133,7 @@ func containerAssertNotExists(eng *engine.Engine, id string, t log.Fataler) {
 
 // assertHttpNotError expect the given response to not have an error.
 // Otherwise the it causes the test to fail.
-func assertHttpNotError(r *httptest.ResponseRecorder, t log.Fataler) {
+func assertHttpNotError(r *httptest.ResponseRecorder, t Fataler) {
 	// Non-error http status are [200, 400)
 	if r.Code < http.StatusOK || r.Code >= http.StatusBadRequest {
 		t.Fatal(fmt.Errorf("Unexpected http error: %v", r.Code))
@@ -139,14 +142,14 @@ func assertHttpNotError(r *httptest.ResponseRecorder, t log.Fataler) {
 
 // assertHttpError expect the given response to have an error.
 // Otherwise the it causes the test to fail.
-func assertHttpError(r *httptest.ResponseRecorder, t log.Fataler) {
+func assertHttpError(r *httptest.ResponseRecorder, t Fataler) {
 	// Non-error http status are [200, 400)
 	if !(r.Code < http.StatusOK || r.Code >= http.StatusBadRequest) {
 		t.Fatal(fmt.Errorf("Unexpected http success code: %v", r.Code))
 	}
 }
 
-func getContainer(eng *engine.Engine, id string, t log.Fataler) *daemon.Container {
+func getContainer(eng *engine.Engine, id string, t Fataler) *daemon.Container {
 	daemon := mkDaemonFromEngine(eng, t)
 	c := daemon.Get(id)
 	if c == nil {
@@ -155,7 +158,7 @@ func getContainer(eng *engine.Engine, id string, t log.Fataler) *daemon.Containe
 	return c
 }
 
-func mkDaemonFromEngine(eng *engine.Engine, t log.Fataler) *daemon.Daemon {
+func mkDaemonFromEngine(eng *engine.Engine, t Fataler) *daemon.Daemon {
 	iDaemon := eng.Hack_GetGlobalVar("httpapi.daemon")
 	if iDaemon == nil {
 		panic("Legacy daemon field not set in engine")
@@ -167,7 +170,7 @@ func mkDaemonFromEngine(eng *engine.Engine, t log.Fataler) *daemon.Daemon {
 	return daemon
 }
 
-func newTestEngine(t log.Fataler, autorestart bool, root string) *engine.Engine {
+func newTestEngine(t Fataler, autorestart bool, root string) *engine.Engine {
 	if root == "" {
 		if dir, err := newTestDirectory(unitTestStoreBase); err != nil {
 			t.Fatal(err)
@@ -200,7 +203,7 @@ func newTestEngine(t log.Fataler, autorestart bool, root string) *engine.Engine
 	return eng
 }
 
-func NewTestEngine(t log.Fataler) *engine.Engine {
+func NewTestEngine(t Fataler) *engine.Engine {
 	return newTestEngine(t, false, "")
 }
 

+ 1 - 1
pkg/archive/archive.go

@@ -19,7 +19,7 @@ import (
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
 
 	"github.com/docker/docker/pkg/fileutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/pools"
 	"github.com/docker/docker/pkg/promise"
 	"github.com/docker/docker/pkg/system"

+ 1 - 1
pkg/archive/changes.go

@@ -12,7 +12,7 @@ import (
 
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/pools"
 	"github.com/docker/docker/pkg/system"
 )

+ 1 - 1
pkg/broadcastwriter/broadcastwriter.go

@@ -7,7 +7,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/pkg/jsonlog"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // BroadcastWriter accumulate multiple io.WriteCloser by stream.

+ 1 - 1
pkg/fileutils/fileutils.go

@@ -1,7 +1,7 @@
 package fileutils
 
 import (
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"path/filepath"
 )
 

+ 1 - 1
pkg/httputils/resumablerequestreader.go

@@ -6,7 +6,7 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 type resumableRequestReader struct {

+ 1 - 1
pkg/iptables/iptables.go

@@ -9,7 +9,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 type Action string

+ 9 - 0
pkg/log/log.go

@@ -8,9 +8,18 @@ import (
 	"strings"
 	"time"
 
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/timeutils"
 )
 
+func init() {
+	log.SetOutput(os.Stderr)
+	log.SetLevel(log.InfoLevel)
+	if os.Getenv("DEBUG") != "" {
+		log.SetLevel(log.DebugLevel)
+	}
+}
+
 type priority int
 
 const (

+ 1 - 1
pkg/signal/trap.go

@@ -6,7 +6,7 @@ import (
 	"sync/atomic"
 	"syscall"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // Trap sets up a simplified signal "trap", appropriate for common

+ 1 - 1
pkg/stdcopy/stdcopy.go

@@ -5,7 +5,7 @@ import (
 	"errors"
 	"io"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 const (

+ 1 - 1
pkg/tarsum/tarsum.go

@@ -13,7 +13,7 @@ import (
 
 	"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 const (

+ 1 - 1
registry/endpoint.go

@@ -9,7 +9,7 @@ import (
 	"net/url"
 	"strings"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // scans string for api version in the URL path. returns the trimmed hostname, if version found, string and API version.

+ 1 - 1
registry/registry_mock_test.go

@@ -15,7 +15,7 @@ import (
 
 	"github.com/gorilla/mux"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 var (

+ 1 - 1
registry/session.go

@@ -18,7 +18,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/pkg/httputils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/pkg/tarsum"
 	"github.com/docker/docker/utils"
 )

+ 1 - 1
registry/session_v2.go

@@ -8,7 +8,7 @@ import (
 	"net/url"
 	"strconv"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/utils"
 	"github.com/gorilla/mux"
 )

+ 1 - 1
runconfig/merge.go

@@ -4,7 +4,7 @@ import (
 	"strings"
 
 	"github.com/docker/docker/nat"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 func Merge(userConf, imageConf *Config) error {

+ 1 - 1
trust/service.go

@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/docker/docker/engine"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/libtrust"
 )
 

+ 1 - 1
trust/trusts.go

@@ -12,7 +12,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/libtrust/trustgraph"
 )
 

+ 1 - 1
utils/http.go

@@ -5,7 +5,7 @@ import (
 	"net/http"
 	"strings"
 
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 // VersionInfo is used to model entities which has a version.

+ 1 - 1
utils/utils.go

@@ -23,7 +23,7 @@ import (
 	"github.com/docker/docker/dockerversion"
 	"github.com/docker/docker/pkg/fileutils"
 	"github.com/docker/docker/pkg/ioutils"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 )
 
 type KeyValuePair struct {

+ 1 - 1
volumes/repository.go

@@ -8,7 +8,7 @@ import (
 	"sync"
 
 	"github.com/docker/docker/daemon/graphdriver"
-	"github.com/docker/docker/pkg/log"
+	log "github.com/Sirupsen/logrus"
 	"github.com/docker/docker/utils"
 )