diff --git a/api/server/httputils/errors.go b/api/server/httputils/errors.go index 82da21c2a0..b677f95d6a 100644 --- a/api/server/httputils/errors.go +++ b/api/server/httputils/errors.go @@ -4,10 +4,10 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" "github.com/gorilla/mux" + "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" ) diff --git a/api/server/httputils/httputils.go b/api/server/httputils/httputils.go index 92cb67c56c..4708d7d16e 100644 --- a/api/server/httputils/httputils.go +++ b/api/server/httputils/httputils.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/middleware.go b/api/server/middleware.go index 537ce8028f..653d554288 100644 --- a/api/server/middleware.go +++ b/api/server/middleware.go @@ -1,9 +1,9 @@ package server import ( - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/server/middleware" + "github.com/sirupsen/logrus" ) // handlerWithGlobalMiddlewares wraps the handler function for a request with diff --git a/api/server/middleware/cors.go b/api/server/middleware/cors.go index ea725dbc72..8ee19a343d 100644 --- a/api/server/middleware/cors.go +++ b/api/server/middleware/cors.go @@ -3,7 +3,7 @@ package middleware import ( "net/http" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/middleware/debug.go b/api/server/middleware/debug.go index a9a94e7f33..7b867f1ebf 100644 --- a/api/server/middleware/debug.go +++ b/api/server/middleware/debug.go @@ -7,9 +7,9 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/pkg/ioutils" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/router/build/build_routes.go b/api/server/router/build/build_routes.go index baa1da303f..d9a123915d 100644 --- a/api/server/router/build/build_routes.go +++ b/api/server/router/build/build_routes.go @@ -12,7 +12,6 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/types" @@ -24,6 +23,7 @@ import ( "github.com/docker/docker/pkg/streamformatter" units "github.com/docker/go-units" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go index 96b1010e19..57204b2e88 100644 --- a/api/server/router/container/container_routes.go +++ b/api/server/router/container/container_routes.go @@ -8,7 +8,6 @@ import ( "strconv" "syscall" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/types" @@ -19,6 +18,7 @@ import ( containerpkg "github.com/docker/docker/container" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/signal" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "golang.org/x/net/websocket" ) diff --git a/api/server/router/container/exec.go b/api/server/router/container/exec.go index 1134a0e797..64629b69ae 100644 --- a/api/server/router/container/exec.go +++ b/api/server/router/container/exec.go @@ -7,11 +7,11 @@ import ( "net/http" "strconv" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" "github.com/docker/docker/pkg/stdcopy" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/router/swarm/cluster_routes.go b/api/server/router/swarm/cluster_routes.go index 91461da764..a1e18f5fad 100644 --- a/api/server/router/swarm/cluster_routes.go +++ b/api/server/router/swarm/cluster_routes.go @@ -6,7 +6,6 @@ import ( "net/http" "strconv" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/errors" "github.com/docker/docker/api/server/httputils" basictypes "github.com/docker/docker/api/types" @@ -14,6 +13,7 @@ import ( "github.com/docker/docker/api/types/filters" types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/versions" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/router/system/system_routes.go b/api/server/router/system/system_routes.go index 30fb000e1d..cd8c3a9fb8 100644 --- a/api/server/router/system/system_routes.go +++ b/api/server/router/system/system_routes.go @@ -6,7 +6,6 @@ import ( "net/http" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/api/errors" "github.com/docker/docker/api/server/httputils" @@ -18,6 +17,7 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/pkg/ioutils" pkgerrors "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/api/server/server.go b/api/server/server.go index e0f2d89d9a..55edcec335 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -7,7 +7,6 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/errors" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/server/middleware" @@ -15,6 +14,7 @@ import ( "github.com/docker/docker/api/server/router/debug" "github.com/docker/docker/dockerversion" "github.com/gorilla/mux" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/builder/dockerfile/builder.go b/builder/dockerfile/builder.go index c47840777e..1d7fa413f8 100644 --- a/builder/dockerfile/builder.go +++ b/builder/dockerfile/builder.go @@ -9,7 +9,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/api/types/container" @@ -26,6 +25,7 @@ import ( "github.com/docker/docker/pkg/system" "github.com/moby/buildkit/session" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "golang.org/x/sync/syncmap" ) diff --git a/builder/dockerfile/containerbackend.go b/builder/dockerfile/containerbackend.go index 7b241f3d3b..d11c95270b 100644 --- a/builder/dockerfile/containerbackend.go +++ b/builder/dockerfile/containerbackend.go @@ -4,13 +4,13 @@ import ( "fmt" "io" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/builder" containerpkg "github.com/docker/docker/container" "github.com/docker/docker/pkg/stringid" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/builder/dockerfile/dispatchers.go b/builder/dockerfile/dispatchers.go index 1f74241248..24a0a1c4df 100644 --- a/builder/dockerfile/dispatchers.go +++ b/builder/dockerfile/dispatchers.go @@ -17,7 +17,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/strslice" @@ -29,6 +28,7 @@ import ( "github.com/docker/docker/pkg/system" "github.com/docker/go-connections/nat" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // ENV foo bar diff --git a/builder/dockerfile/imagecontext.go b/builder/dockerfile/imagecontext.go index 64b2572b85..fedad6fdf3 100644 --- a/builder/dockerfile/imagecontext.go +++ b/builder/dockerfile/imagecontext.go @@ -4,12 +4,12 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/builder" "github.com/docker/docker/builder/remotecontext" dockerimage "github.com/docker/docker/image" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/builder/dockerfile/imageprobe.go b/builder/dockerfile/imageprobe.go index 3433612de5..239eb9e38f 100644 --- a/builder/dockerfile/imageprobe.go +++ b/builder/dockerfile/imageprobe.go @@ -1,9 +1,9 @@ package dockerfile import ( - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/container" "github.com/docker/docker/builder" + "github.com/sirupsen/logrus" ) // ImageProber exposes an Image cache to the Builder. It supports resetting a diff --git a/builder/fscache/fscache.go b/builder/fscache/fscache.go index eba65b8eb7..faef7d1ac1 100644 --- a/builder/fscache/fscache.go +++ b/builder/fscache/fscache.go @@ -8,7 +8,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/docker/docker/builder" "github.com/docker/docker/builder/remotecontext" @@ -16,6 +15,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/moby/buildkit/session/filesync" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/tonistiigi/fsutil" "golang.org/x/net/context" "golang.org/x/sync/singleflight" diff --git a/builder/remotecontext/detect.go b/builder/remotecontext/detect.go index 4345736805..ec32dbed7a 100644 --- a/builder/remotecontext/detect.go +++ b/builder/remotecontext/detect.go @@ -8,7 +8,6 @@ import ( "path/filepath" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/builder" "github.com/docker/docker/builder/dockerfile/parser" @@ -17,6 +16,7 @@ import ( "github.com/docker/docker/pkg/symlink" "github.com/docker/docker/pkg/urlutil" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // ClientSessionRemote is identifier for client-session context transport diff --git a/cli/debug/debug.go b/cli/debug/debug.go index 51dfab2a97..b00ea63ad8 100644 --- a/cli/debug/debug.go +++ b/cli/debug/debug.go @@ -3,7 +3,7 @@ package debug import ( "os" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // Enable sets the DEBUG env var to true diff --git a/cli/debug/debug_test.go b/cli/debug/debug_test.go index ad8412a944..903115283c 100644 --- a/cli/debug/debug_test.go +++ b/cli/debug/debug_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) func TestEnable(t *testing.T) { diff --git a/cmd/dockerd/daemon.go b/cmd/dockerd/daemon.go index faa927dd6d..1facf608a9 100644 --- a/cmd/dockerd/daemon.go +++ b/cmd/dockerd/daemon.go @@ -9,7 +9,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/uuid" "github.com/docker/docker/api" apiserver "github.com/docker/docker/api/server" @@ -51,6 +50,7 @@ import ( swarmapi "github.com/docker/swarmkit/api" "github.com/moby/buildkit/session" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) diff --git a/cmd/dockerd/daemon_test.go b/cmd/dockerd/daemon_test.go index 7ae91fe1a7..1b81aa5734 100644 --- a/cmd/dockerd/daemon_test.go +++ b/cmd/dockerd/daemon_test.go @@ -3,10 +3,10 @@ package main import ( "testing" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/config" "github.com/docker/docker/pkg/testutil" "github.com/docker/docker/pkg/testutil/tempfile" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/dockerd/daemon_windows.go b/cmd/dockerd/daemon_windows.go index 2e9598d4cf..7dd0920ce7 100644 --- a/cmd/dockerd/daemon_windows.go +++ b/cmd/dockerd/daemon_windows.go @@ -6,9 +6,9 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" "github.com/docker/docker/libcontainerd" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/cmd/dockerd/docker.go b/cmd/dockerd/docker.go index 8a5c8f5433..2ccca46c18 100644 --- a/cmd/dockerd/docker.go +++ b/cmd/dockerd/docker.go @@ -6,12 +6,12 @@ import ( "path/filepath" "runtime" - "github.com/Sirupsen/logrus" "github.com/docker/docker/cli" "github.com/docker/docker/daemon/config" "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/term" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/cmd/dockerd/metrics.go b/cmd/dockerd/metrics.go index 0c8860408b..99d41cb3aa 100644 --- a/cmd/dockerd/metrics.go +++ b/cmd/dockerd/metrics.go @@ -4,8 +4,8 @@ import ( "net" "net/http" - "github.com/Sirupsen/logrus" metrics "github.com/docker/go-metrics" + "github.com/sirupsen/logrus" ) func startMetricsServer(addr string) error { diff --git a/cmd/dockerd/options.go b/cmd/dockerd/options.go index 629b0223e9..4fd597d610 100644 --- a/cmd/dockerd/options.go +++ b/cmd/dockerd/options.go @@ -5,11 +5,11 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" cliconfig "github.com/docker/docker/cli/config" "github.com/docker/docker/daemon/config" "github.com/docker/docker/opts" "github.com/docker/go-connections/tlsconfig" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) diff --git a/cmd/dockerd/service_windows.go b/cmd/dockerd/service_windows.go index 0172169517..00432af643 100644 --- a/cmd/dockerd/service_windows.go +++ b/cmd/dockerd/service_windows.go @@ -12,8 +12,8 @@ import ( "time" "unsafe" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" "golang.org/x/sys/windows" "golang.org/x/sys/windows/svc" diff --git a/container/container.go b/container/container.go index 86e0111445..23de3f581a 100644 --- a/container/container.go +++ b/container/container.go @@ -15,7 +15,6 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" containertypes "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" networktypes "github.com/docker/docker/api/types/network" @@ -44,6 +43,7 @@ import ( "github.com/docker/libnetwork/options" "github.com/docker/libnetwork/types" agentexec "github.com/docker/swarmkit/agent/exec" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/container/container_unix.go b/container/container_unix.go index 327f950ff8..6a08e562ea 100644 --- a/container/container_unix.go +++ b/container/container_unix.go @@ -9,7 +9,6 @@ import ( "path/filepath" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" @@ -20,6 +19,7 @@ import ( "github.com/docker/docker/pkg/system" "github.com/docker/docker/volume" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/container/health.go b/container/health.go index 31c5600d25..5919008d27 100644 --- a/container/health.go +++ b/container/health.go @@ -1,8 +1,8 @@ package container import ( - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" + "github.com/sirupsen/logrus" ) // Health holds the current container health-check state diff --git a/container/monitor.go b/container/monitor.go index f05e72b25f..f35097b2cd 100644 --- a/container/monitor.go +++ b/container/monitor.go @@ -3,7 +3,7 @@ package container import ( "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) const ( diff --git a/container/stream/attach.go b/container/stream/attach.go index 3dd53d3354..24b68863d7 100644 --- a/container/stream/attach.go +++ b/container/stream/attach.go @@ -6,10 +6,10 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/pools" "github.com/docker/docker/pkg/promise" "github.com/docker/docker/pkg/term" + "github.com/sirupsen/logrus" ) var defaultEscapeSequence = []byte{16, 17} // ctrl-p, ctrl-q diff --git a/container/stream/streams.go b/container/stream/streams.go index 735bab5107..7e734d81c4 100644 --- a/container/stream/streams.go +++ b/container/stream/streams.go @@ -7,11 +7,11 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/libcontainerd" "github.com/docker/docker/pkg/broadcaster" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/pools" + "github.com/sirupsen/logrus" ) // Config holds information about I/O streams managed together. diff --git a/container/view.go b/container/view.go index 4b6c70259b..8d885268c2 100644 --- a/container/view.go +++ b/container/view.go @@ -6,11 +6,11 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" "github.com/hashicorp/go-memdb" + "github.com/sirupsen/logrus" ) const ( diff --git a/contrib/docker-device-tool/device_tool.go b/contrib/docker-device-tool/device_tool.go index fc171666fa..8f6251582a 100644 --- a/contrib/docker-device-tool/device_tool.go +++ b/contrib/docker-device-tool/device_tool.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver/devmapper" "github.com/docker/docker/pkg/devicemapper" + "github.com/sirupsen/logrus" ) func usage() { diff --git a/daemon/attach.go b/daemon/attach.go index 32410393a3..115c315764 100644 --- a/daemon/attach.go +++ b/daemon/attach.go @@ -5,7 +5,6 @@ import ( "fmt" "io" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/container" @@ -13,6 +12,7 @@ import ( "github.com/docker/docker/daemon/logger" "github.com/docker/docker/pkg/stdcopy" "github.com/docker/docker/pkg/term" + "github.com/sirupsen/logrus" ) // ContainerAttach attaches to logs according to the config passed in. See ContainerAttachConfig. diff --git a/daemon/build.go b/daemon/build.go index 14767e57b4..39269ab5a2 100644 --- a/daemon/build.go +++ b/daemon/build.go @@ -4,7 +4,6 @@ import ( "io" "runtime" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" @@ -15,6 +14,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cache.go b/daemon/cache.go index 219b0b38da..5ad68ec0af 100644 --- a/daemon/cache.go +++ b/daemon/cache.go @@ -1,9 +1,9 @@ package daemon import ( - "github.com/Sirupsen/logrus" "github.com/docker/docker/builder" "github.com/docker/docker/image/cache" + "github.com/sirupsen/logrus" ) // MakeImageCache creates a stateful image cache. diff --git a/daemon/cluster/cluster.go b/daemon/cluster/cluster.go index 57fc4d2d6f..55540fc06c 100644 --- a/daemon/cluster/cluster.go +++ b/daemon/cluster/cluster.go @@ -46,7 +46,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/network" types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/controllers/plugin" @@ -56,6 +55,7 @@ import ( swarmapi "github.com/docker/swarmkit/api" swarmnode "github.com/docker/swarmkit/node" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/controllers/plugin/controller.go b/daemon/cluster/controllers/plugin/controller.go index e72edcdd75..8cc9b04e36 100644 --- a/daemon/cluster/controllers/plugin/controller.go +++ b/daemon/cluster/controllers/plugin/controller.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "net/http" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" enginetypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm/runtime" @@ -14,6 +13,7 @@ import ( "github.com/docker/swarmkit/api" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/controllers/plugin/controller_test.go b/daemon/cluster/controllers/plugin/controller_test.go index 17b77cc89f..70bb91b12e 100644 --- a/daemon/cluster/controllers/plugin/controller_test.go +++ b/daemon/cluster/controllers/plugin/controller_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" enginetypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm/runtime" "github.com/docker/docker/pkg/pubsub" "github.com/docker/docker/plugin" "github.com/docker/docker/plugin/v2" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/convert/container.go b/daemon/cluster/convert/container.go index 6ac6f331f2..795e944ae1 100644 --- a/daemon/cluster/convert/container.go +++ b/daemon/cluster/convert/container.go @@ -5,12 +5,12 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" container "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" types "github.com/docker/docker/api/types/swarm" swarmapi "github.com/docker/swarmkit/api" gogotypes "github.com/gogo/protobuf/types" + "github.com/sirupsen/logrus" ) func containerSpecFromGRPC(c *swarmapi.ContainerSpec) *types.ContainerSpec { diff --git a/daemon/cluster/executor/container/adapter.go b/daemon/cluster/executor/container/adapter.go index 7444057c35..0a33739669 100644 --- a/daemon/cluster/executor/container/adapter.go +++ b/daemon/cluster/executor/container/adapter.go @@ -12,7 +12,6 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" @@ -28,6 +27,7 @@ import ( "github.com/docker/swarmkit/log" gogotypes "github.com/gogo/protobuf/types" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "golang.org/x/time/rate" ) diff --git a/daemon/cluster/executor/container/container.go b/daemon/cluster/executor/container/container.go index 3ca7b5dcef..8ea4126d73 100644 --- a/daemon/cluster/executor/container/container.go +++ b/daemon/cluster/executor/container/container.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" diff --git a/daemon/cluster/executor/container/executor.go b/daemon/cluster/executor/container/executor.go index f6fb6e55be..3a6188bff4 100644 --- a/daemon/cluster/executor/container/executor.go +++ b/daemon/cluster/executor/container/executor.go @@ -5,7 +5,6 @@ import ( "sort" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/network" @@ -19,6 +18,7 @@ import ( "github.com/docker/swarmkit/agent/exec" "github.com/docker/swarmkit/api" "github.com/docker/swarmkit/api/naming" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/networks.go b/daemon/cluster/networks.go index 1906c37bd2..3b271dbc8d 100644 --- a/daemon/cluster/networks.go +++ b/daemon/cluster/networks.go @@ -3,7 +3,6 @@ package cluster import ( "fmt" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" apitypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" @@ -12,6 +11,7 @@ import ( "github.com/docker/docker/runconfig" swarmapi "github.com/docker/swarmkit/api" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/noderunner.go b/daemon/cluster/noderunner.go index b970e7b217..aa12737cdd 100644 --- a/daemon/cluster/noderunner.go +++ b/daemon/cluster/noderunner.go @@ -8,13 +8,13 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" types "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/cluster/executor/container" lncluster "github.com/docker/libnetwork/cluster" swarmapi "github.com/docker/swarmkit/api" swarmnode "github.com/docker/swarmkit/node" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" ) diff --git a/daemon/cluster/services.go b/daemon/cluster/services.go index 4f99802067..c1cc5b9f58 100644 --- a/daemon/cluster/services.go +++ b/daemon/cluster/services.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" apierrors "github.com/docker/docker/api/errors" apitypes "github.com/docker/docker/api/types" @@ -22,6 +21,7 @@ import ( swarmapi "github.com/docker/swarmkit/api" gogotypes "github.com/gogo/protobuf/types" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/cluster/swarm.go b/daemon/cluster/swarm.go index ef0596b6cc..2b34d89a6a 100644 --- a/daemon/cluster/swarm.go +++ b/daemon/cluster/swarm.go @@ -6,7 +6,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" apitypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" @@ -18,6 +17,7 @@ import ( "github.com/docker/swarmkit/manager/encryption" swarmnode "github.com/docker/swarmkit/node" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/config/config.go b/daemon/config/config.go index 5adb7e69e6..61c8deff70 100644 --- a/daemon/config/config.go +++ b/daemon/config/config.go @@ -12,13 +12,13 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" daemondiscovery "github.com/docker/docker/daemon/discovery" "github.com/docker/docker/opts" "github.com/docker/docker/pkg/authorization" "github.com/docker/docker/pkg/discovery" "github.com/docker/docker/registry" "github.com/imdario/mergo" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) diff --git a/daemon/configs.go b/daemon/configs.go index 31da56b2d3..9d9137c42f 100644 --- a/daemon/configs.go +++ b/daemon/configs.go @@ -1,8 +1,8 @@ package daemon import ( - "github.com/Sirupsen/logrus" swarmtypes "github.com/docker/docker/api/types/swarm" + "github.com/sirupsen/logrus" ) // SetContainerConfigReferences sets the container config references needed diff --git a/daemon/container_operations.go b/daemon/container_operations.go index 7c7dcc7ced..70eee6e003 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" derr "github.com/docker/docker/api/errors" containertypes "github.com/docker/docker/api/types/container" networktypes "github.com/docker/docker/api/types/network" @@ -24,6 +23,7 @@ import ( "github.com/docker/libnetwork/netlabel" "github.com/docker/libnetwork/options" "github.com/docker/libnetwork/types" + "github.com/sirupsen/logrus" ) var ( diff --git a/daemon/container_operations_unix.go b/daemon/container_operations_unix.go index 8c1b44b601..fe635b22bb 100644 --- a/daemon/container_operations_unix.go +++ b/daemon/container_operations_unix.go @@ -11,7 +11,6 @@ import ( "strconv" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/container" "github.com/docker/docker/daemon/links" "github.com/docker/docker/pkg/idtools" @@ -21,6 +20,7 @@ import ( "github.com/docker/libnetwork" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/container_operations_windows.go b/daemon/container_operations_windows.go index 2788f1a7cd..51762a2441 100644 --- a/daemon/container_operations_windows.go +++ b/daemon/container_operations_windows.go @@ -5,11 +5,11 @@ import ( "io/ioutil" "os" - "github.com/Sirupsen/logrus" "github.com/docker/docker/container" "github.com/docker/docker/pkg/system" "github.com/docker/libnetwork" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]string, error) { diff --git a/daemon/create.go b/daemon/create.go index 78070fd29d..cf61336597 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -9,7 +9,6 @@ import ( "github.com/pkg/errors" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/pkg/system" "github.com/docker/docker/runconfig" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" ) // CreateManagedContainer creates a container that is managed by a Service diff --git a/daemon/create_unix.go b/daemon/create_unix.go index 2501a3374a..1940e9c64e 100644 --- a/daemon/create_unix.go +++ b/daemon/create_unix.go @@ -7,12 +7,12 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" containertypes "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/container" "github.com/docker/docker/pkg/stringid" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" ) // createContainerPlatformSpecificSettings performs platform specific container create functionality diff --git a/daemon/daemon.go b/daemon/daemon.go index 4d4b98c8de..ebfdb68d1d 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -18,7 +18,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" containerd "github.com/containerd/containerd/api/grpc/types" "github.com/docker/docker/api" "github.com/docker/docker/api/types" @@ -31,6 +30,7 @@ import ( "github.com/docker/docker/daemon/exec" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/opts" + "github.com/sirupsen/logrus" // register graph drivers _ "github.com/docker/docker/daemon/graphdriver/register" "github.com/docker/docker/daemon/initlayer" diff --git a/daemon/daemon_linux.go b/daemon/daemon_linux.go index 000a048699..56ed4ce95a 100644 --- a/daemon/daemon_linux.go +++ b/daemon/daemon_linux.go @@ -8,9 +8,9 @@ import ( "regexp" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/fileutils" "github.com/docker/docker/pkg/mount" + "github.com/sirupsen/logrus" ) // On Linux, plugins use a static path for storing execution state, diff --git a/daemon/daemon_solaris.go b/daemon/daemon_solaris.go index f464ee34b8..53fc6ea925 100644 --- a/daemon/daemon_solaris.go +++ b/daemon/daemon_solaris.go @@ -7,7 +7,6 @@ import ( "net" "strconv" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" @@ -27,6 +26,7 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) //#include diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 562b7496a7..ea306ee857 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -16,7 +16,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/blkiodev" pblkiodev "github.com/docker/docker/api/types/blkiodev" @@ -44,6 +43,7 @@ import ( specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" "golang.org/x/sys/unix" ) diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index 798ba39971..d299d52df6 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -8,7 +8,6 @@ import ( "syscall" "github.com/Microsoft/hcsshim" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" @@ -28,6 +27,7 @@ import ( "github.com/docker/libnetwork/netlabel" "github.com/docker/libnetwork/options" blkiodev "github.com/opencontainers/runc/libcontainer/configs" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/daemon/debugtrap_unix.go b/daemon/debugtrap_unix.go index 39298dfd62..8ea696d961 100644 --- a/daemon/debugtrap_unix.go +++ b/daemon/debugtrap_unix.go @@ -6,8 +6,8 @@ import ( "os" "os/signal" - "github.com/Sirupsen/logrus" stackdump "github.com/docker/docker/pkg/signal" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/debugtrap_windows.go b/daemon/debugtrap_windows.go index dfaf953244..6bd83e5446 100644 --- a/daemon/debugtrap_windows.go +++ b/daemon/debugtrap_windows.go @@ -6,9 +6,9 @@ import ( "unsafe" winio "github.com/Microsoft/go-winio" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/daemon/delete.go b/daemon/delete.go index 61ee6eb684..aea33c84c8 100644 --- a/daemon/delete.go +++ b/daemon/delete.go @@ -7,7 +7,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" "github.com/docker/docker/container" @@ -15,6 +14,7 @@ import ( "github.com/docker/docker/pkg/system" volumestore "github.com/docker/docker/volume/store" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // ContainerRm removes the container id from the filesystem. An error diff --git a/daemon/discovery/discovery.go b/daemon/discovery/discovery.go index 509155cbbd..4b1b15faa0 100644 --- a/daemon/discovery/discovery.go +++ b/daemon/discovery/discovery.go @@ -6,8 +6,8 @@ import ( "strconv" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/discovery" + "github.com/sirupsen/logrus" // Register the libkv backends for discovery. _ "github.com/docker/docker/pkg/discovery/kv" diff --git a/daemon/disk_usage.go b/daemon/disk_usage.go index c64a243304..23bce4f70b 100644 --- a/daemon/disk_usage.go +++ b/daemon/disk_usage.go @@ -6,13 +6,13 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/directory" "github.com/docker/docker/volume" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) func (daemon *Daemon) getLayerRefs(platform string) map[layer.ChainID]int { diff --git a/daemon/events.go b/daemon/events.go index 7ae851802e..e302a4f43d 100644 --- a/daemon/events.go +++ b/daemon/events.go @@ -6,7 +6,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/events" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/container" @@ -14,6 +13,7 @@ import ( "github.com/docker/libnetwork" swarmapi "github.com/docker/swarmkit/api" gogotypes "github.com/gogo/protobuf/types" + "github.com/sirupsen/logrus" ) var ( diff --git a/daemon/exec.go b/daemon/exec.go index 72d01c8c23..e77970968c 100644 --- a/daemon/exec.go +++ b/daemon/exec.go @@ -8,7 +8,6 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/strslice" @@ -19,6 +18,7 @@ import ( "github.com/docker/docker/pkg/pools" "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/term" + "github.com/sirupsen/logrus" ) // Seconds to wait after sending TERM before trying KILL diff --git a/daemon/exec/exec.go b/daemon/exec/exec.go index 933136f965..471113cc4a 100644 --- a/daemon/exec/exec.go +++ b/daemon/exec/exec.go @@ -4,10 +4,10 @@ import ( "runtime" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/container/stream" "github.com/docker/docker/libcontainerd" "github.com/docker/docker/pkg/stringid" + "github.com/sirupsen/logrus" ) // Config holds the configurations for execs. The Daemon keeps diff --git a/daemon/getsize_unix.go b/daemon/getsize_unix.go index 434fa4388a..e47e646df3 100644 --- a/daemon/getsize_unix.go +++ b/daemon/getsize_unix.go @@ -5,7 +5,7 @@ package daemon import ( "runtime" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // getSize returns the real size & virtual size of the container. diff --git a/daemon/graphdriver/aufs/aufs.go b/daemon/graphdriver/aufs/aufs.go index c099b88aed..81edb8ea94 100644 --- a/daemon/graphdriver/aufs/aufs.go +++ b/daemon/graphdriver/aufs/aufs.go @@ -35,7 +35,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/chrootarchive" @@ -47,6 +46,7 @@ import ( rsystem "github.com/opencontainers/runc/libcontainer/system" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/storage" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/aufs/mount.go b/daemon/graphdriver/aufs/mount.go index 890213b80e..100e7537a9 100644 --- a/daemon/graphdriver/aufs/mount.go +++ b/daemon/graphdriver/aufs/mount.go @@ -5,7 +5,7 @@ package aufs import ( "os/exec" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/btrfs/btrfs.go b/daemon/graphdriver/btrfs/btrfs.go index 25998422c5..dcdfc9a867 100644 --- a/daemon/graphdriver/btrfs/btrfs.go +++ b/daemon/graphdriver/btrfs/btrfs.go @@ -26,7 +26,6 @@ import ( "sync" "unsafe" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/mount" @@ -34,6 +33,7 @@ import ( "github.com/docker/docker/pkg/system" "github.com/docker/go-units" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/devmapper/device_setup.go b/daemon/graphdriver/devmapper/device_setup.go index ef6cffbf20..05a295cb69 100644 --- a/daemon/graphdriver/devmapper/device_setup.go +++ b/daemon/graphdriver/devmapper/device_setup.go @@ -12,8 +12,8 @@ import ( "reflect" "strings" - "github.com/Sirupsen/logrus" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) type directLVMConfig struct { diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go index 906daf639b..32a41c6a8b 100644 --- a/daemon/graphdriver/devmapper/deviceset.go +++ b/daemon/graphdriver/devmapper/deviceset.go @@ -18,7 +18,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/devicemapper" @@ -29,6 +28,7 @@ import ( units "github.com/docker/go-units" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/devmapper/driver.go b/daemon/graphdriver/devmapper/driver.go index 243d88a8bb..02ee0124f1 100644 --- a/daemon/graphdriver/devmapper/driver.go +++ b/daemon/graphdriver/devmapper/driver.go @@ -9,7 +9,7 @@ import ( "path" "strconv" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/devicemapper" diff --git a/daemon/graphdriver/driver.go b/daemon/graphdriver/driver.go index 88f190d9e1..94c52094c3 100644 --- a/daemon/graphdriver/driver.go +++ b/daemon/graphdriver/driver.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/storage" "github.com/docker/docker/pkg/archive" diff --git a/daemon/graphdriver/driver_solaris.go b/daemon/graphdriver/driver_solaris.go index 06dc360cf5..121fd9230d 100644 --- a/daemon/graphdriver/driver_solaris.go +++ b/daemon/graphdriver/driver_solaris.go @@ -19,8 +19,8 @@ import ( "path/filepath" "unsafe" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/mount" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/graphdriver/fsdiff.go b/daemon/graphdriver/fsdiff.go index 20826cd7d2..e8c7ff27a4 100644 --- a/daemon/graphdriver/fsdiff.go +++ b/daemon/graphdriver/fsdiff.go @@ -4,11 +4,11 @@ import ( "io" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/chrootarchive" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/ioutils" + "github.com/sirupsen/logrus" ) var ( diff --git a/daemon/graphdriver/lcow/lcow.go b/daemon/graphdriver/lcow/lcow.go index 75c775bb59..e2b311dd47 100644 --- a/daemon/graphdriver/lcow/lcow.go +++ b/daemon/graphdriver/lcow/lcow.go @@ -32,13 +32,13 @@ import ( "time" "github.com/Microsoft/hcsshim" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/system" "github.com/jhowardmsft/opengcs/gogcs/client" + "github.com/sirupsen/logrus" ) // init registers this driver to the register. It gets initialised by the diff --git a/daemon/graphdriver/overlay/overlay.go b/daemon/graphdriver/overlay/overlay.go index 9db2e9405f..0d14b045f9 100644 --- a/daemon/graphdriver/overlay/overlay.go +++ b/daemon/graphdriver/overlay/overlay.go @@ -12,7 +12,6 @@ import ( "path" "strconv" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/daemon/graphdriver/overlayutils" "github.com/docker/docker/pkg/archive" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/system" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/overlay2/check.go b/daemon/graphdriver/overlay2/check.go index 35e088aa32..851c4099c7 100644 --- a/daemon/graphdriver/overlay2/check.go +++ b/daemon/graphdriver/overlay2/check.go @@ -9,9 +9,9 @@ import ( "path" "path/filepath" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/system" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/overlay2/overlay.go b/daemon/graphdriver/overlay2/overlay.go index 4ef2a8caaf..6b0d4be869 100644 --- a/daemon/graphdriver/overlay2/overlay.go +++ b/daemon/graphdriver/overlay2/overlay.go @@ -16,7 +16,7 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/daemon/graphdriver/overlayutils" diff --git a/daemon/graphdriver/overlay2/randomid.go b/daemon/graphdriver/overlay2/randomid.go index 04212c0694..30d6f3b1cf 100644 --- a/daemon/graphdriver/overlay2/randomid.go +++ b/daemon/graphdriver/overlay2/randomid.go @@ -11,7 +11,7 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/quota/projectquota.go b/daemon/graphdriver/quota/projectquota.go index b784dc4afc..0e70515434 100644 --- a/daemon/graphdriver/quota/projectquota.go +++ b/daemon/graphdriver/quota/projectquota.go @@ -56,7 +56,7 @@ import ( "path/filepath" "unsafe" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/windows/windows.go b/daemon/graphdriver/windows/windows.go index 49c8d34a57..44114051bb 100644 --- a/daemon/graphdriver/windows/windows.go +++ b/daemon/graphdriver/windows/windows.go @@ -24,7 +24,6 @@ import ( "github.com/Microsoft/go-winio/archive/tar" "github.com/Microsoft/go-winio/backuptar" "github.com/Microsoft/hcsshim" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/idtools" @@ -33,6 +32,7 @@ import ( "github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/system" units "github.com/docker/go-units" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/daemon/graphdriver/zfs/zfs.go b/daemon/graphdriver/zfs/zfs.go index a772cc9ee6..729099a6cd 100644 --- a/daemon/graphdriver/zfs/zfs.go +++ b/daemon/graphdriver/zfs/zfs.go @@ -12,13 +12,13 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/parsers" zfs "github.com/mistifyio/go-zfs" "github.com/opencontainers/selinux/go-selinux/label" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/zfs/zfs_freebsd.go b/daemon/graphdriver/zfs/zfs_freebsd.go index e02012afe2..bbc3216fc2 100644 --- a/daemon/graphdriver/zfs/zfs_freebsd.go +++ b/daemon/graphdriver/zfs/zfs_freebsd.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/zfs/zfs_linux.go b/daemon/graphdriver/zfs/zfs_linux.go index 53aa4c8c6f..71d6d3cb4d 100644 --- a/daemon/graphdriver/zfs/zfs_linux.go +++ b/daemon/graphdriver/zfs/zfs_linux.go @@ -3,8 +3,8 @@ package zfs import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/graphdriver/zfs/zfs_solaris.go b/daemon/graphdriver/zfs/zfs_solaris.go index bb4a85bd64..d63642252d 100644 --- a/daemon/graphdriver/zfs/zfs_solaris.go +++ b/daemon/graphdriver/zfs/zfs_solaris.go @@ -20,8 +20,8 @@ import ( "strings" "unsafe" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/graphdriver" + "github.com/sirupsen/logrus" ) func checkRootdirFs(rootdir string) error { diff --git a/daemon/health.go b/daemon/health.go index 61b531484e..c8e84a2d1f 100644 --- a/daemon/health.go +++ b/daemon/health.go @@ -10,12 +10,12 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/strslice" "github.com/docker/docker/container" "github.com/docker/docker/daemon/exec" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/info.go b/daemon/info.go index 1de899f797..1c4aa561bd 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -7,7 +7,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/api/types" "github.com/docker/docker/cli/debug" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/registry" "github.com/docker/docker/volume/drivers" "github.com/docker/go-connections/sockets" + "github.com/sirupsen/logrus" ) // SystemInfo returns information about the host server the daemon is running on. diff --git a/daemon/info_unix.go b/daemon/info_unix.go index e816f8dff1..f43af6274f 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -7,11 +7,11 @@ import ( "os/exec" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/sysinfo" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // FillPlatformInfo fills the platform related info. diff --git a/daemon/kill.go b/daemon/kill.go index b118160f84..586c9661fb 100644 --- a/daemon/kill.go +++ b/daemon/kill.go @@ -8,9 +8,9 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" containerpkg "github.com/docker/docker/container" "github.com/docker/docker/pkg/signal" + "github.com/sirupsen/logrus" ) type errNoSuchProcess struct { diff --git a/daemon/list.go b/daemon/list.go index 6889c55889..5906ed3a69 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -7,13 +7,13 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/container" "github.com/docker/docker/image" "github.com/docker/docker/volume" "github.com/docker/go-connections/nat" + "github.com/sirupsen/logrus" ) var acceptedVolumeFilterTags = map[string]bool{ diff --git a/daemon/logger/adapter.go b/daemon/logger/adapter.go index a187b30fdd..98852e89c1 100644 --- a/daemon/logger/adapter.go +++ b/daemon/logger/adapter.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/plugins/logdriver" "github.com/docker/docker/pkg/plugingetter" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // pluginAdapter takes a plugin and implements the Logger interface for logger diff --git a/daemon/logger/awslogs/cloudwatchlogs.go b/daemon/logger/awslogs/cloudwatchlogs.go index 6cef8d0ae5..cabfcbd8d3 100644 --- a/daemon/logger/awslogs/cloudwatchlogs.go +++ b/daemon/logger/awslogs/cloudwatchlogs.go @@ -13,7 +13,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/ec2metadata" @@ -25,6 +24,7 @@ import ( "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/templates" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/logger/copier.go b/daemon/logger/copier.go index 65d8fb148e..c773fc6a29 100644 --- a/daemon/logger/copier.go +++ b/daemon/logger/copier.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/logger/etwlogs/etwlogs_windows.go b/daemon/logger/etwlogs/etwlogs_windows.go index 8608f15ca1..aa530e7d9a 100644 --- a/daemon/logger/etwlogs/etwlogs_windows.go +++ b/daemon/logger/etwlogs/etwlogs_windows.go @@ -18,8 +18,8 @@ import ( "sync" "unsafe" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/daemon/logger/fluentd/fluentd.go b/daemon/logger/fluentd/fluentd.go index c8977ec0da..6a0653ef26 100644 --- a/daemon/logger/fluentd/fluentd.go +++ b/daemon/logger/fluentd/fluentd.go @@ -11,13 +11,13 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/urlutil" "github.com/docker/go-units" "github.com/fluent/fluent-logger-golang/fluent" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) type fluentd struct { diff --git a/daemon/logger/gcplogs/gcplogging.go b/daemon/logger/gcplogs/gcplogging.go index a33566ae1f..5fdd137dd2 100644 --- a/daemon/logger/gcplogs/gcplogging.go +++ b/daemon/logger/gcplogs/gcplogging.go @@ -10,7 +10,7 @@ import ( "cloud.google.com/go/compute/metadata" "cloud.google.com/go/logging" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/net/context" mrpb "google.golang.org/genproto/googleapis/api/monitoredres" ) diff --git a/daemon/logger/gcplogs/gcplogging_linux.go b/daemon/logger/gcplogs/gcplogging_linux.go index 9af8b3c17e..8917bdd4c7 100644 --- a/daemon/logger/gcplogs/gcplogging_linux.go +++ b/daemon/logger/gcplogs/gcplogging_linux.go @@ -5,9 +5,9 @@ package gcplogs import ( "os" - "github.com/Sirupsen/logrus" "github.com/docker/docker/dockerversion" "github.com/docker/docker/pkg/homedir" + "github.com/sirupsen/logrus" ) // ensureHomeIfIAmStatic ensure $HOME to be set if dockerversion.IAmStatic is "true". diff --git a/daemon/logger/gelf/gelf.go b/daemon/logger/gelf/gelf.go index 4b0130dfbe..de209ce9bf 100644 --- a/daemon/logger/gelf/gelf.go +++ b/daemon/logger/gelf/gelf.go @@ -14,10 +14,10 @@ import ( "time" "github.com/Graylog2/go-gelf/gelf" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/urlutil" + "github.com/sirupsen/logrus" ) const name = "gelf" diff --git a/daemon/logger/journald/journald.go b/daemon/logger/journald/journald.go index 86d7378b5b..46aac8328b 100644 --- a/daemon/logger/journald/journald.go +++ b/daemon/logger/journald/journald.go @@ -9,10 +9,10 @@ import ( "sync" "unicode" - "github.com/Sirupsen/logrus" "github.com/coreos/go-systemd/journal" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" + "github.com/sirupsen/logrus" ) const name = "journald" diff --git a/daemon/logger/journald/read.go b/daemon/logger/journald/read.go index 4c6301a207..4d9b999a50 100644 --- a/daemon/logger/journald/read.go +++ b/daemon/logger/journald/read.go @@ -155,10 +155,10 @@ import ( "time" "unsafe" - "github.com/Sirupsen/logrus" "github.com/coreos/go-systemd/journal" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" + "github.com/sirupsen/logrus" ) func (s *journald) Close() error { diff --git a/daemon/logger/jsonfilelog/jsonfilelog.go b/daemon/logger/jsonfilelog/jsonfilelog.go index e8df0ecbd0..c5f12d0021 100644 --- a/daemon/logger/jsonfilelog/jsonfilelog.go +++ b/daemon/logger/jsonfilelog/jsonfilelog.go @@ -11,12 +11,12 @@ import ( "strconv" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/jsonlog" "github.com/docker/go-units" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // Name is the name of the file that the jsonlogger logs to. diff --git a/daemon/logger/jsonfilelog/read.go b/daemon/logger/jsonfilelog/read.go index db53fd53e0..32425b5128 100644 --- a/daemon/logger/jsonfilelog/read.go +++ b/daemon/logger/jsonfilelog/read.go @@ -11,7 +11,6 @@ import ( "github.com/fsnotify/fsnotify" "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/backend" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/jsonfilelog/multireader" @@ -19,6 +18,7 @@ import ( "github.com/docker/docker/pkg/jsonlog" "github.com/docker/docker/pkg/tailfile" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) const maxJSONDecodeRetry = 20000 diff --git a/daemon/logger/logentries/logentries.go b/daemon/logger/logentries/logentries.go index a353d9d49a..7f6ff471db 100644 --- a/daemon/logger/logentries/logentries.go +++ b/daemon/logger/logentries/logentries.go @@ -5,9 +5,9 @@ package logentries import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/bsphere/le_go" "github.com/docker/docker/daemon/logger" + "github.com/sirupsen/logrus" ) type logentries struct { diff --git a/daemon/logger/ring.go b/daemon/logger/ring.go index 5c55955474..dea8f6b6a4 100644 --- a/daemon/logger/ring.go +++ b/daemon/logger/ring.go @@ -5,7 +5,7 @@ import ( "sync" "sync/atomic" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/logger/splunk/splunk.go b/daemon/logger/splunk/splunk.go index 233a2db96f..7319a3e3d5 100644 --- a/daemon/logger/splunk/splunk.go +++ b/daemon/logger/splunk/splunk.go @@ -18,10 +18,10 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/urlutil" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/logger/syslog/syslog.go b/daemon/logger/syslog/syslog.go index 42855e1174..b4cacd7af8 100644 --- a/daemon/logger/syslog/syslog.go +++ b/daemon/logger/syslog/syslog.go @@ -14,11 +14,11 @@ import ( syslog "github.com/RackSec/srslog" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/pkg/urlutil" "github.com/docker/go-connections/tlsconfig" + "github.com/sirupsen/logrus" ) const ( diff --git a/daemon/logs.go b/daemon/logs.go index 96e1b8a491..2bd57ee533 100644 --- a/daemon/logs.go +++ b/daemon/logs.go @@ -7,13 +7,13 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/backend" containertypes "github.com/docker/docker/api/types/container" timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/container" "github.com/docker/docker/daemon/logger" + "github.com/sirupsen/logrus" ) // ContainerLogs copies the container's log channel to the channel provided in diff --git a/daemon/metrics.go b/daemon/metrics.go index bf9e49d044..0d9f37e8db 100644 --- a/daemon/metrics.go +++ b/daemon/metrics.go @@ -4,12 +4,12 @@ import ( "path/filepath" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/go-metrics" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" ) const metricsPluginType = "MetricsCollector" diff --git a/daemon/metrics_unix.go b/daemon/metrics_unix.go index 84166d1a80..6045939a58 100644 --- a/daemon/metrics_unix.go +++ b/daemon/metrics_unix.go @@ -8,12 +8,12 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/plugins" metrics "github.com/docker/go-metrics" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/daemon/monitor.go b/daemon/monitor.go index 5156d9a8e1..3fd7bffb87 100644 --- a/daemon/monitor.go +++ b/daemon/monitor.go @@ -7,11 +7,11 @@ import ( "strconv" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/container" "github.com/docker/docker/libcontainerd" "github.com/docker/docker/restartmanager" + "github.com/sirupsen/logrus" ) func (daemon *Daemon) setStateCounter(c *container.Container) { diff --git a/daemon/names.go b/daemon/names.go index 7cdabeba9f..845c4e9953 100644 --- a/daemon/names.go +++ b/daemon/names.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/container" "github.com/docker/docker/pkg/namesgenerator" "github.com/docker/docker/pkg/stringid" + "github.com/sirupsen/logrus" ) var ( diff --git a/daemon/network.go b/daemon/network.go index 366c2a59e4..22f94bcb32 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -8,7 +8,6 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" @@ -21,6 +20,7 @@ import ( "github.com/docker/libnetwork/ipamapi" networktypes "github.com/docker/libnetwork/types" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index 6d74301a05..9f666f8799 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -11,7 +11,6 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" "github.com/docker/docker/daemon/caps" @@ -27,6 +26,7 @@ import ( "github.com/opencontainers/runc/libcontainer/devices" "github.com/opencontainers/runc/libcontainer/user" specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" ) var ( diff --git a/daemon/prune.go b/daemon/prune.go index 9f8a545e7c..824e0cd833 100644 --- a/daemon/prune.go +++ b/daemon/prune.go @@ -7,7 +7,6 @@ import ( "sync/atomic" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" @@ -20,6 +19,7 @@ import ( "github.com/docker/docker/volume" "github.com/docker/libnetwork" digest "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/daemon/reload.go b/daemon/reload.go index 0200bcf06e..a71d31efc2 100644 --- a/daemon/reload.go +++ b/daemon/reload.go @@ -4,10 +4,10 @@ import ( "encoding/json" "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/discovery" "github.com/docker/docker/libcontainerd" + "github.com/sirupsen/logrus" ) // Reload reads configuration changes and modifies the diff --git a/daemon/rename.go b/daemon/rename.go index 686fbd3b99..b714ece7f9 100644 --- a/daemon/rename.go +++ b/daemon/rename.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" dockercontainer "github.com/docker/docker/container" "github.com/docker/libnetwork" + "github.com/sirupsen/logrus" ) // ContainerRename changes the name of a container, using the oldName diff --git a/daemon/restart.go b/daemon/restart.go index 9f2ef569af..e030cfaed5 100644 --- a/daemon/restart.go +++ b/daemon/restart.go @@ -3,8 +3,8 @@ package daemon import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/docker/container" + "github.com/sirupsen/logrus" ) // ContainerRestart stops and starts a container. It attempts to diff --git a/daemon/seccomp_linux.go b/daemon/seccomp_linux.go index 472e3133c0..3fce213490 100644 --- a/daemon/seccomp_linux.go +++ b/daemon/seccomp_linux.go @@ -5,10 +5,10 @@ package daemon import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/docker/container" "github.com/docker/docker/profiles/seccomp" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" ) var supportsSeccomp = true diff --git a/daemon/secrets.go b/daemon/secrets.go index 90fa99e987..214391fe84 100644 --- a/daemon/secrets.go +++ b/daemon/secrets.go @@ -1,8 +1,8 @@ package daemon import ( - "github.com/Sirupsen/logrus" swarmtypes "github.com/docker/docker/api/types/swarm" + "github.com/sirupsen/logrus" ) // SetContainerSecretReferences sets the container secret references needed diff --git a/daemon/start.go b/daemon/start.go index 8d938519c4..290b099e3d 100644 --- a/daemon/start.go +++ b/daemon/start.go @@ -10,11 +10,11 @@ import ( "google.golang.org/grpc" - "github.com/Sirupsen/logrus" apierrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" + "github.com/sirupsen/logrus" ) // ContainerStart starts a container. diff --git a/daemon/stats/collector.go b/daemon/stats/collector.go index 0520efa238..c06d80c172 100644 --- a/daemon/stats/collector.go +++ b/daemon/stats/collector.go @@ -5,10 +5,10 @@ package stats import ( "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/container" "github.com/docker/docker/pkg/pubsub" + "github.com/sirupsen/logrus" ) // Collect registers the container with the collector and adds it to diff --git a/daemon/stop.go b/daemon/stop.go index 6a4776d155..af3020eaba 100644 --- a/daemon/stop.go +++ b/daemon/stop.go @@ -6,9 +6,9 @@ import ( "net/http" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/errors" containerpkg "github.com/docker/docker/container" + "github.com/sirupsen/logrus" ) // ContainerStop looks for the given container and terminates it, diff --git a/daemon/volumes.go b/daemon/volumes.go index 6f24f05910..c2372ef572 100644 --- a/daemon/volumes.go +++ b/daemon/volumes.go @@ -9,7 +9,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" dockererrors "github.com/docker/docker/api/errors" "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" @@ -17,6 +16,7 @@ import ( "github.com/docker/docker/container" "github.com/docker/docker/volume" "github.com/docker/docker/volume/drivers" + "github.com/sirupsen/logrus" ) var ( diff --git a/distribution/errors.go b/distribution/errors.go index f453c01cc0..0e4942d6a6 100644 --- a/distribution/errors.go +++ b/distribution/errors.go @@ -5,7 +5,6 @@ import ( "strings" "syscall" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/api/errcode" @@ -14,6 +13,7 @@ import ( "github.com/docker/distribution/registry/client/auth" "github.com/docker/docker/distribution/xfer" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // ErrNoSupport is an error type used for errors indicating that an operation diff --git a/distribution/pull.go b/distribution/pull.go index c5bdbd6d3b..690551c842 100644 --- a/distribution/pull.go +++ b/distribution/pull.go @@ -3,7 +3,6 @@ package distribution import ( "fmt" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api" "github.com/docker/docker/distribution/metadata" @@ -11,6 +10,7 @@ import ( refstore "github.com/docker/docker/reference" "github.com/docker/docker/registry" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/pull_v1.go b/distribution/pull_v1.go index 7151a7584d..eb62146422 100644 --- a/distribution/pull_v1.go +++ b/distribution/pull_v1.go @@ -11,7 +11,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/distribution/metadata" @@ -24,6 +23,7 @@ import ( "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/pull_v2.go b/distribution/pull_v2.go index 50257f5cb4..713e9b7da7 100644 --- a/distribution/pull_v2.go +++ b/distribution/pull_v2.go @@ -10,7 +10,6 @@ import ( "os" "runtime" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/manifest/manifestlist" "github.com/docker/distribution/manifest/schema1" @@ -31,6 +30,7 @@ import ( refstore "github.com/docker/docker/reference" "github.com/docker/docker/registry" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/pull_v2_windows.go b/distribution/pull_v2_windows.go index 543ecc10eb..e10070d53a 100644 --- a/distribution/pull_v2_windows.go +++ b/distribution/pull_v2_windows.go @@ -6,11 +6,11 @@ import ( "net/http" "os" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/context" "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/registry/client/transport" + "github.com/sirupsen/logrus" ) var _ distribution.Describable = &v2LayerDescriptor{} diff --git a/distribution/push.go b/distribution/push.go index 395e4d1512..25b49faf5e 100644 --- a/distribution/push.go +++ b/distribution/push.go @@ -6,11 +6,11 @@ import ( "fmt" "io" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/distribution/metadata" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/registry" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/push_v1.go b/distribution/push_v1.go index 431faaf28c..4da4d5eac4 100644 --- a/distribution/push_v1.go +++ b/distribution/push_v1.go @@ -4,7 +4,6 @@ import ( "fmt" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/distribution/metadata" @@ -17,6 +16,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/push_v2.go b/distribution/push_v2.go index ffc7d68107..3d32061e8a 100644 --- a/distribution/push_v2.go +++ b/distribution/push_v2.go @@ -11,7 +11,6 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/manifest/schema2" @@ -26,6 +25,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) const ( diff --git a/distribution/registry_unit_test.go b/distribution/registry_unit_test.go index 910061f45a..d6b6ee8832 100644 --- a/distribution/registry_unit_test.go +++ b/distribution/registry_unit_test.go @@ -11,13 +11,13 @@ import ( "strings" "testing" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/registry" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/utils/progress.go b/distribution/utils/progress.go index cc3632a534..96380fdb24 100644 --- a/distribution/utils/progress.go +++ b/distribution/utils/progress.go @@ -6,9 +6,9 @@ import ( "os" "syscall" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/progress" "github.com/docker/docker/pkg/streamformatter" + "github.com/sirupsen/logrus" ) // WriteDistributionProgress is a helper for writing progress from chan to JSON diff --git a/distribution/xfer/download.go b/distribution/xfer/download.go index 6769ee1cdf..6ee0aa57b8 100644 --- a/distribution/xfer/download.go +++ b/distribution/xfer/download.go @@ -7,13 +7,13 @@ import ( "runtime" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/progress" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/distribution/xfer/upload.go b/distribution/xfer/upload.go index 58422e57a1..3310a3c684 100644 --- a/distribution/xfer/upload.go +++ b/distribution/xfer/upload.go @@ -4,10 +4,10 @@ import ( "errors" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/progress" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/hack/integration-cli-on-swarm/host/host.go b/hack/integration-cli-on-swarm/host/host.go index 6823a76686..fdc2a83e7f 100644 --- a/hack/integration-cli-on-swarm/host/host.go +++ b/hack/integration-cli-on-swarm/host/host.go @@ -10,11 +10,11 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" + "github.com/sirupsen/logrus" ) const ( diff --git a/image/fs.go b/image/fs.go index 10f6dab5fc..92cdb2662a 100644 --- a/image/fs.go +++ b/image/fs.go @@ -7,10 +7,10 @@ import ( "path/filepath" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/ioutils" "github.com/opencontainers/go-digest" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // DigestWalkFunc is function called by StoreBackend.Walk diff --git a/image/rootfs.go b/image/rootfs.go index 5a9020f0ed..fb5f674c84 100644 --- a/image/rootfs.go +++ b/image/rootfs.go @@ -3,8 +3,8 @@ package image import ( "runtime" - "github.com/Sirupsen/logrus" "github.com/docker/docker/layer" + "github.com/sirupsen/logrus" ) // TypeLayers is used for RootFS.Type for filesystems organized into layers. diff --git a/image/store.go b/image/store.go index c85f8d6830..1a3045f58a 100644 --- a/image/store.go +++ b/image/store.go @@ -7,12 +7,12 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/digestset" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/system" "github.com/opencontainers/go-digest" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // Store is an interface for creating and accessing images diff --git a/image/tarexport/load.go b/image/tarexport/load.go index af8cefc6ad..d69c9342ad 100644 --- a/image/tarexport/load.go +++ b/image/tarexport/load.go @@ -11,7 +11,6 @@ import ( "reflect" "runtime" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/reference" "github.com/docker/docker/image" @@ -25,6 +24,7 @@ import ( "github.com/docker/docker/pkg/symlink" "github.com/docker/docker/pkg/system" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) func (l *tarexporter) Load(inTar io.ReadCloser, outStream io.Writer, quiet bool) error { diff --git a/image/v1/imagev1.go b/image/v1/imagev1.go index 0e8a23cb5d..697d59e335 100644 --- a/image/v1/imagev1.go +++ b/image/v1/imagev1.go @@ -5,12 +5,12 @@ import ( "reflect" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types/versions" "github.com/docker/docker/image" "github.com/docker/docker/layer" "github.com/docker/docker/pkg/stringid" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) // noFallbackMinVersion is the minimum version for which v1compatibility diff --git a/integration-cli/events_utils_test.go b/integration-cli/events_utils_test.go index 9350edcb96..580188950a 100644 --- a/integration-cli/events_utils_test.go +++ b/integration-cli/events_utils_test.go @@ -9,10 +9,10 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" eventstestutils "github.com/docker/docker/daemon/events/testutils" "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" + "github.com/sirupsen/logrus" ) // eventMatcher is a function that tries to match an event input. diff --git a/layer/filestore.go b/layer/filestore.go index 533f45481a..d813555525 100644 --- a/layer/filestore.go +++ b/layer/filestore.go @@ -13,10 +13,10 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/docker/pkg/ioutils" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) var ( diff --git a/layer/layer.go b/layer/layer.go index b3480a0cc1..e269ef8a4a 100644 --- a/layer/layer.go +++ b/layer/layer.go @@ -13,10 +13,10 @@ import ( "errors" "io" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/docker/pkg/archive" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) var ( diff --git a/layer/layer_store.go b/layer/layer_store.go index 75ac1e4f48..7283014459 100644 --- a/layer/layer_store.go +++ b/layer/layer_store.go @@ -8,7 +8,6 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/idtools" @@ -16,6 +15,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/system" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/asm" "github.com/vbatts/tar-split/tar/storage" ) diff --git a/layer/migration.go b/layer/migration.go index 4803a1ae56..f4c4adec4a 100644 --- a/layer/migration.go +++ b/layer/migration.go @@ -7,8 +7,8 @@ import ( "io" "os" - "github.com/Sirupsen/logrus" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" "github.com/vbatts/tar-split/tar/asm" "github.com/vbatts/tar-split/tar/storage" ) diff --git a/libcontainerd/client_linux.go b/libcontainerd/client_linux.go index 54eaf35530..6c3460a8c9 100644 --- a/libcontainerd/client_linux.go +++ b/libcontainerd/client_linux.go @@ -7,7 +7,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" containerd "github.com/containerd/containerd/api/grpc/types" containerd_runtime_types "github.com/containerd/containerd/runtime" "github.com/docker/docker/pkg/ioutils" @@ -15,6 +14,7 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "golang.org/x/sys/unix" ) diff --git a/libcontainerd/client_unix.go b/libcontainerd/client_unix.go index 6dbf3af06e..129e87bd72 100644 --- a/libcontainerd/client_unix.go +++ b/libcontainerd/client_unix.go @@ -10,10 +10,10 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" containerd "github.com/containerd/containerd/api/grpc/types" "github.com/docker/docker/pkg/idtools" specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/libcontainerd/client_windows.go b/libcontainerd/client_windows.go index 455e8e5e6c..d1fd2d8f91 100644 --- a/libcontainerd/client_windows.go +++ b/libcontainerd/client_windows.go @@ -15,9 +15,9 @@ import ( "golang.org/x/net/context" "github.com/Microsoft/hcsshim" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/sysinfo" specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" ) type client struct { diff --git a/libcontainerd/container_unix.go b/libcontainerd/container_unix.go index 869f88523f..9a7dbf01cd 100644 --- a/libcontainerd/container_unix.go +++ b/libcontainerd/container_unix.go @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" containerd "github.com/containerd/containerd/api/grpc/types" "github.com/docker/docker/pkg/ioutils" specs "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" "github.com/tonistiigi/fifo" "golang.org/x/net/context" "golang.org/x/sys/unix" diff --git a/libcontainerd/container_windows.go b/libcontainerd/container_windows.go index e895fa0302..b29ac3c5a4 100644 --- a/libcontainerd/container_windows.go +++ b/libcontainerd/container_windows.go @@ -9,9 +9,9 @@ import ( "time" "github.com/Microsoft/hcsshim" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/system" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/libcontainerd/oom_linux.go b/libcontainerd/oom_linux.go index e126b7a550..70f0daca5f 100644 --- a/libcontainerd/oom_linux.go +++ b/libcontainerd/oom_linux.go @@ -5,8 +5,8 @@ import ( "os" "strconv" - "github.com/Sirupsen/logrus" "github.com/opencontainers/runc/libcontainer/system" + "github.com/sirupsen/logrus" ) func setOOMScore(pid, score int) error { diff --git a/libcontainerd/remote_unix.go b/libcontainerd/remote_unix.go index 24fbc5ad60..7bab53e796 100644 --- a/libcontainerd/remote_unix.go +++ b/libcontainerd/remote_unix.go @@ -17,12 +17,12 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" containerd "github.com/containerd/containerd/api/grpc/types" "github.com/docker/docker/pkg/locker" "github.com/docker/docker/pkg/system" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" + "github.com/sirupsen/logrus" "golang.org/x/net/context" "golang.org/x/sys/unix" "google.golang.org/grpc" diff --git a/migrate/v1/migratev1.go b/migrate/v1/migratev1.go index 3cb8828915..60dbfe0787 100644 --- a/migrate/v1/migratev1.go +++ b/migrate/v1/migratev1.go @@ -13,7 +13,6 @@ import ( "encoding/json" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/distribution/metadata" "github.com/docker/docker/image" @@ -22,6 +21,7 @@ import ( "github.com/docker/docker/pkg/ioutils" refstore "github.com/docker/docker/reference" "github.com/opencontainers/go-digest" + "github.com/sirupsen/logrus" ) type graphIDRegistrar interface { diff --git a/pkg/archive/archive.go b/pkg/archive/archive.go index 6cbc2e2bd2..b3c84ee156 100644 --- a/pkg/archive/archive.go +++ b/pkg/archive/archive.go @@ -16,13 +16,13 @@ import ( "strings" "syscall" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/fileutils" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/pools" "github.com/docker/docker/pkg/promise" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" ) type ( diff --git a/pkg/archive/changes.go b/pkg/archive/changes.go index 5ca39b7215..341c66dea7 100644 --- a/pkg/archive/changes.go +++ b/pkg/archive/changes.go @@ -13,10 +13,10 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/pools" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" ) // ChangeType represents the change type. diff --git a/pkg/archive/copy.go b/pkg/archive/copy.go index 5281e29d18..3adf8a275c 100644 --- a/pkg/archive/copy.go +++ b/pkg/archive/copy.go @@ -9,8 +9,8 @@ import ( "path/filepath" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" ) // Errors used or returned by this file. diff --git a/pkg/archive/diff.go b/pkg/archive/diff.go index a2766b5928..019facd383 100644 --- a/pkg/archive/diff.go +++ b/pkg/archive/diff.go @@ -10,10 +10,10 @@ import ( "runtime" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/pools" "github.com/docker/docker/pkg/system" + "github.com/sirupsen/logrus" ) // UnpackLayer unpack `layer` to a `dest`. The stream `layer` can be diff --git a/pkg/archive/example_changes.go b/pkg/archive/example_changes.go index cedd46a408..495db809e9 100644 --- a/pkg/archive/example_changes.go +++ b/pkg/archive/example_changes.go @@ -13,8 +13,8 @@ import ( "os" "path" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/archive" + "github.com/sirupsen/logrus" ) var ( diff --git a/pkg/authorization/authz.go b/pkg/authorization/authz.go index dc9a9ae56f..b52446add6 100644 --- a/pkg/authorization/authz.go +++ b/pkg/authorization/authz.go @@ -8,8 +8,8 @@ import ( "net/http" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/ioutils" + "github.com/sirupsen/logrus" ) const maxBodySize = 1048576 // 1MB diff --git a/pkg/authorization/middleware.go b/pkg/authorization/middleware.go index 7789a758df..24a457ae1d 100644 --- a/pkg/authorization/middleware.go +++ b/pkg/authorization/middleware.go @@ -4,8 +4,8 @@ import ( "net/http" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/plugingetter" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/pkg/authorization/response.go b/pkg/authorization/response.go index 129bf2f417..cea64f2e80 100644 --- a/pkg/authorization/response.go +++ b/pkg/authorization/response.go @@ -8,7 +8,7 @@ import ( "net" "net/http" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // ResponseModifier allows authorization plugins to read and modify the content of the http.response diff --git a/pkg/devicemapper/devmapper.go b/pkg/devicemapper/devmapper.go index f331970802..d65b802db1 100644 --- a/pkg/devicemapper/devmapper.go +++ b/pkg/devicemapper/devmapper.go @@ -9,7 +9,7 @@ import ( "runtime" "unsafe" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/pkg/devicemapper/devmapper_log.go b/pkg/devicemapper/devmapper_log.go index 098d2405ed..d2c0d4c76a 100644 --- a/pkg/devicemapper/devmapper_log.go +++ b/pkg/devicemapper/devmapper_log.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // DevmapperLogger defines methods required to register as a callback for diff --git a/pkg/discovery/backends.go b/pkg/discovery/backends.go index 2eab550e29..a25b86c3e6 100644 --- a/pkg/discovery/backends.go +++ b/pkg/discovery/backends.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) var ( diff --git a/pkg/discovery/kv/kv.go b/pkg/discovery/kv/kv.go index 77eee7d454..e860b369e7 100644 --- a/pkg/discovery/kv/kv.go +++ b/pkg/discovery/kv/kv.go @@ -6,7 +6,6 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/discovery" "github.com/docker/go-connections/tlsconfig" "github.com/docker/libkv" @@ -14,6 +13,7 @@ import ( "github.com/docker/libkv/store/consul" "github.com/docker/libkv/store/etcd" "github.com/docker/libkv/store/zookeeper" + "github.com/sirupsen/logrus" ) const ( diff --git a/pkg/filenotify/poller.go b/pkg/filenotify/poller.go index b90111bb4f..1dc9482e02 100644 --- a/pkg/filenotify/poller.go +++ b/pkg/filenotify/poller.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "github.com/fsnotify/fsnotify" ) diff --git a/pkg/fileutils/fileutils.go b/pkg/fileutils/fileutils.go index 57cc087340..a129e654ea 100644 --- a/pkg/fileutils/fileutils.go +++ b/pkg/fileutils/fileutils.go @@ -10,7 +10,7 @@ import ( "strings" "text/scanner" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // PatternMatcher allows checking paths agaist a list of patterns diff --git a/pkg/fileutils/fileutils_unix.go b/pkg/fileutils/fileutils_unix.go index d5c3abf568..9e0e97bd64 100644 --- a/pkg/fileutils/fileutils_unix.go +++ b/pkg/fileutils/fileutils_unix.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "os" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // GetTotalUsedFds Returns the number of used File Descriptors by diff --git a/pkg/listeners/listeners_solaris.go b/pkg/listeners/listeners_solaris.go index c9003bcf68..ee1bd0fccf 100644 --- a/pkg/listeners/listeners_solaris.go +++ b/pkg/listeners/listeners_solaris.go @@ -6,8 +6,8 @@ import ( "net" "os" - "github.com/Sirupsen/logrus" "github.com/docker/go-connections/sockets" + "github.com/sirupsen/logrus" ) // Init creates new listeners for the server. diff --git a/pkg/listeners/listeners_unix.go b/pkg/listeners/listeners_unix.go index 25c98fba17..dc54606894 100644 --- a/pkg/listeners/listeners_unix.go +++ b/pkg/listeners/listeners_unix.go @@ -9,9 +9,9 @@ import ( "os" "strconv" - "github.com/Sirupsen/logrus" "github.com/coreos/go-systemd/activation" "github.com/docker/go-connections/sockets" + "github.com/sirupsen/logrus" ) // Init creates new listeners for the server. diff --git a/pkg/loopback/attach_loopback.go b/pkg/loopback/attach_loopback.go index 6ea9a309d3..27326d7fe5 100644 --- a/pkg/loopback/attach_loopback.go +++ b/pkg/loopback/attach_loopback.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/pkg/loopback/loopback.go b/pkg/loopback/loopback.go index 36f433d0be..c620c63336 100644 --- a/pkg/loopback/loopback.go +++ b/pkg/loopback/loopback.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/pkg/parsers/kernel/kernel_unix.go b/pkg/parsers/kernel/kernel_unix.go index bd137dfb6f..76e1e499f3 100644 --- a/pkg/parsers/kernel/kernel_unix.go +++ b/pkg/parsers/kernel/kernel_unix.go @@ -7,7 +7,7 @@ package kernel import ( "bytes" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) // GetKernelVersion gets the current kernel version. diff --git a/pkg/platform/platform.go b/pkg/platform/platform.go index e4b03122f4..2845c3c197 100644 --- a/pkg/platform/platform.go +++ b/pkg/platform/platform.go @@ -3,7 +3,7 @@ package platform import ( "runtime" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) var ( diff --git a/pkg/plugins/client.go b/pkg/plugins/client.go index f221a46fcf..9ee1f89976 100644 --- a/pkg/plugins/client.go +++ b/pkg/plugins/client.go @@ -9,10 +9,10 @@ import ( "net/url" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/pkg/plugins/transport" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" + "github.com/sirupsen/logrus" ) const ( diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index c0059cba75..f9033ed1bc 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -27,8 +27,8 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/go-connections/tlsconfig" + "github.com/sirupsen/logrus" ) var ( diff --git a/pkg/signal/trap.go b/pkg/signal/trap.go index 638a1ab66c..172bc1064f 100644 --- a/pkg/signal/trap.go +++ b/pkg/signal/trap.go @@ -11,8 +11,8 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) // Trap sets up a simplified signal "trap", appropriate for common diff --git a/pkg/sysinfo/sysinfo_linux.go b/pkg/sysinfo/sysinfo_linux.go index 50ae265bb6..471f786a70 100644 --- a/pkg/sysinfo/sysinfo_linux.go +++ b/pkg/sysinfo/sysinfo_linux.go @@ -7,8 +7,8 @@ import ( "path" "strings" - "github.com/Sirupsen/logrus" "github.com/opencontainers/runc/libcontainer/cgroups" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/pkg/system/syscall_windows.go b/pkg/system/syscall_windows.go index eded233b9c..23e9b207c7 100644 --- a/pkg/system/syscall_windows.go +++ b/pkg/system/syscall_windows.go @@ -3,7 +3,7 @@ package system import ( "unsafe" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "golang.org/x/sys/windows" ) diff --git a/pkg/term/windows/windows.go b/pkg/term/windows/windows.go index d67021e45a..c02a93a03f 100644 --- a/pkg/term/windows/windows.go +++ b/pkg/term/windows/windows.go @@ -10,7 +10,7 @@ import ( "sync" ansiterm "github.com/Azure/go-ansiterm" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) var logger *logrus.Logger diff --git a/plugin/backend_linux.go b/plugin/backend_linux.go index 055b8e3107..727a26862a 100644 --- a/plugin/backend_linux.go +++ b/plugin/backend_linux.go @@ -15,7 +15,6 @@ import ( "path/filepath" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" @@ -36,6 +35,7 @@ import ( refstore "github.com/docker/docker/reference" "github.com/opencontainers/go-digest" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/plugin/blobstore.go b/plugin/blobstore.go index 2b79a44270..c1259b6781 100644 --- a/plugin/blobstore.go +++ b/plugin/blobstore.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" - "github.com/Sirupsen/logrus" "github.com/docker/docker/distribution/xfer" "github.com/docker/docker/image" "github.com/docker/docker/layer" @@ -16,6 +15,7 @@ import ( "github.com/docker/docker/pkg/progress" "github.com/opencontainers/go-digest" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/plugin/manager.go b/plugin/manager.go index fada0d667a..6cfa430aab 100644 --- a/plugin/manager.go +++ b/plugin/manager.go @@ -13,7 +13,6 @@ import ( "strings" "sync" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/image" @@ -28,6 +27,7 @@ import ( "github.com/docker/docker/registry" "github.com/opencontainers/go-digest" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) const configFileName = "config.json" diff --git a/plugin/manager_linux.go b/plugin/manager_linux.go index 9b84af68dc..98370daca6 100644 --- a/plugin/manager_linux.go +++ b/plugin/manager_linux.go @@ -10,7 +10,6 @@ import ( "path/filepath" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api/types" "github.com/docker/docker/daemon/initlayer" "github.com/docker/docker/libcontainerd" @@ -22,6 +21,7 @@ import ( "github.com/opencontainers/go-digest" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/plugin/store.go b/plugin/store.go index 7f6e954bf8..acb92d2e5a 100644 --- a/plugin/store.go +++ b/plugin/store.go @@ -4,12 +4,12 @@ import ( "fmt" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/docker/pkg/plugingetter" "github.com/docker/docker/pkg/plugins" "github.com/docker/docker/plugin/v2" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) /* allowV1PluginsFallback determines daemon's support for V1 plugins. diff --git a/registry/auth.go b/registry/auth.go index 8cadd51ba0..f7a8fdc936 100644 --- a/registry/auth.go +++ b/registry/auth.go @@ -8,12 +8,12 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/registry/client/auth" "github.com/docker/distribution/registry/client/auth/challenge" "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/sirupsen/logrus" ) const ( diff --git a/registry/config.go b/registry/config.go index 182599e38d..f4b3bff945 100644 --- a/registry/config.go +++ b/registry/config.go @@ -8,11 +8,11 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/opts" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) diff --git a/registry/endpoint_v1.go b/registry/endpoint_v1.go index c5ca961dd4..59fd72e938 100644 --- a/registry/endpoint_v1.go +++ b/registry/endpoint_v1.go @@ -9,9 +9,9 @@ import ( "net/url" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/registry/client/transport" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/sirupsen/logrus" ) // V1Endpoint stores basic information about a V1 registry endpoint. diff --git a/registry/registry.go b/registry/registry.go index 17fa97ce3d..a676d63450 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -13,10 +13,10 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/registry/client/transport" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" + "github.com/sirupsen/logrus" ) var ( diff --git a/registry/registry_mock_test.go b/registry/registry_mock_test.go index 58b05d3849..204a98344e 100644 --- a/registry/registry_mock_test.go +++ b/registry/registry_mock_test.go @@ -21,7 +21,7 @@ import ( registrytypes "github.com/docker/docker/api/types/registry" "github.com/gorilla/mux" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) var ( diff --git a/registry/resumable/resumablerequestreader.go b/registry/resumable/resumablerequestreader.go index 5403c76847..12075e552c 100644 --- a/registry/resumable/resumablerequestreader.go +++ b/registry/resumable/resumablerequestreader.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" ) type requestReader struct { diff --git a/registry/service.go b/registry/service.go index 34e8a13f9e..b4f747380a 100644 --- a/registry/service.go +++ b/registry/service.go @@ -10,11 +10,11 @@ import ( "golang.org/x/net/context" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/client/auth" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" + "github.com/sirupsen/logrus" ) const ( diff --git a/registry/session.go b/registry/session.go index 9d7f32193f..bc4a244032 100644 --- a/registry/session.go +++ b/registry/session.go @@ -18,7 +18,6 @@ import ( "strconv" "strings" - "github.com/Sirupsen/logrus" "github.com/docker/distribution/reference" "github.com/docker/distribution/registry/api/errcode" "github.com/docker/docker/api/types" @@ -28,6 +27,7 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/tarsum" "github.com/docker/docker/registry/resumable" + "github.com/sirupsen/logrus" ) var ( diff --git a/vendor.conf b/vendor.conf index 23384e4a5a..61924acea2 100644 --- a/vendor.conf +++ b/vendor.conf @@ -2,7 +2,6 @@ github.com/Azure/go-ansiterm 388960b655244e76e24c75f48631564eaefade62 github.com/Microsoft/hcsshim v0.5.25 github.com/Microsoft/go-winio v0.4.2 -github.com/Sirupsen/logrus v0.11.0 github.com/moby/buildkit fed5c1d9cee6f734f58f3addca6e8d1750df48a6 github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76 github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a @@ -12,6 +11,7 @@ github.com/gorilla/mux v1.1 github.com/jhowardmsft/opengcs v0.0.9 github.com/kr/pty 5cf931ef8f github.com/mattn/go-shellwords v1.0.3 +github.com/sirupsen/logrus v1.0.1 github.com/tchap/go-patricia v2.2.6 github.com/vdemeester/shakers 24d7f1d6a71aa5d9cbe7390e4afb66b7eef9e1b3 golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6 diff --git a/vendor/github.com/Sirupsen/logrus/json_formatter.go b/vendor/github.com/Sirupsen/logrus/json_formatter.go deleted file mode 100644 index 2ad6dc5cf4..0000000000 --- a/vendor/github.com/Sirupsen/logrus/json_formatter.go +++ /dev/null @@ -1,41 +0,0 @@ -package logrus - -import ( - "encoding/json" - "fmt" -) - -type JSONFormatter struct { - // TimestampFormat sets the format used for marshaling timestamps. - TimestampFormat string -} - -func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { - data := make(Fields, len(entry.Data)+3) - for k, v := range entry.Data { - switch v := v.(type) { - case error: - // Otherwise errors are ignored by `encoding/json` - // https://github.com/Sirupsen/logrus/issues/137 - data[k] = v.Error() - default: - data[k] = v - } - } - prefixFieldClashes(data) - - timestampFormat := f.TimestampFormat - if timestampFormat == "" { - timestampFormat = DefaultTimestampFormat - } - - data["time"] = entry.Time.Format(timestampFormat) - data["msg"] = entry.Message - data["level"] = entry.Level.String() - - serialized, err := json.Marshal(data) - if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) - } - return append(serialized, '\n'), nil -} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/github.com/Sirupsen/logrus/terminal_solaris.go deleted file mode 100644 index a3c6f6e7df..0000000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build solaris,!appengine - -package logrus - -import ( - "os" - - "golang.org/x/sys/unix" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal() bool { - _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) - return err == nil -} diff --git a/vendor/github.com/Sirupsen/logrus/terminal_windows.go b/vendor/github.com/Sirupsen/logrus/terminal_windows.go deleted file mode 100644 index 3727e8adfb..0000000000 --- a/vendor/github.com/Sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Based on ssh/terminal: -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows,!appengine - -package logrus - -import ( - "syscall" - "unsafe" -) - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -var ( - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") -) - -// IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} diff --git a/vendor/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/sirupsen/logrus/LICENSE similarity index 100% rename from vendor/github.com/Sirupsen/logrus/LICENSE rename to vendor/github.com/sirupsen/logrus/LICENSE diff --git a/vendor/github.com/Sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md similarity index 71% rename from vendor/github.com/Sirupsen/logrus/README.md rename to vendor/github.com/sirupsen/logrus/README.md index 126cd1fc2b..82aeb4eef3 100644 --- a/vendor/github.com/Sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -1,11 +1,24 @@ -# Logrus :walrus: [![Build Status](https://travis-ci.org/Sirupsen/logrus.svg?branch=master)](https://travis-ci.org/Sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/Sirupsen/logrus?status.svg)](https://godoc.org/github.com/Sirupsen/logrus) +# Logrus :walrus: [![Build Status](https://travis-ci.org/sirupsen/logrus.svg?branch=master)](https://travis-ci.org/sirupsen/logrus) [![GoDoc](https://godoc.org/github.com/sirupsen/logrus?status.svg)](https://godoc.org/github.com/sirupsen/logrus) Logrus is a structured logger for Go (golang), completely API compatible with -the standard library logger. [Godoc][godoc]. **Please note the Logrus API is not -yet stable (pre 1.0). Logrus itself is completely stable and has been used in -many large deployments. The core API is unlikely to change much but please -version control your Logrus to make sure you aren't fetching latest `master` on -every build.** +the standard library logger. [Godoc][godoc]. + +**Seeing weird case-sensitive problems?** It's in the past been possible to +import Logrus as both upper- and lower-case. Due to the Go package environment, +this caused issues in the community and we needed a standard. Some environments +experienced problems with the upper-case variant, so the lower-case was decided. +Everything using `logrus` will need to use the lower-case: +`github.com/sirupsen/logrus`. Any package that isn't, should be changed. + +To fix Glide, see [these +comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). +For an in-depth explanation of the casing issue, see [this +comment](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276). + +**Are you interested in assisting in maintaining Logrus?** Currently I have a +lot of obligations, and I am unable to provide Logrus with the maintainership it +needs. If you'd like to help, please reach out to me at `simon at author's +username dot com`. Nicely color-coded in development (when a TTY is attached, otherwise just plain text): @@ -46,6 +59,12 @@ time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x20822 exit status 1 ``` +#### Case-sensitivity + +The organization's name was changed to lower-case--and this will not be changed +back. If you are getting import conflicts due to case sensitivity, please use +the lower-case import: `github.com/sirupsen/logrus`. + #### Example The simplest way to use Logrus is simply the package-level exported logger: @@ -54,7 +73,7 @@ The simplest way to use Logrus is simply the package-level exported logger: package main import ( - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) func main() { @@ -65,7 +84,7 @@ func main() { ``` Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/Sirupsen/logrus"` +replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` and you'll now have the flexibility of Logrus. You can customize it all you want: @@ -74,15 +93,16 @@ package main import ( "os" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) func init() { // Log as JSON instead of the default ASCII formatter. log.SetFormatter(&log.JSONFormatter{}) - // Output to stderr instead of stdout, could also be a file. - log.SetOutput(os.Stderr) + // Output to stdout instead of the default stderr + // Can be any io.Writer, see below for File example + log.SetOutput(os.Stdout) // Only log the warning severity or above. log.SetLevel(log.WarnLevel) @@ -123,7 +143,8 @@ application, you can also create an instance of the `logrus` Logger: package main import ( - "github.com/Sirupsen/logrus" + "os" + "github.com/sirupsen/logrus" ) // Create a new instance of the logger. You can have any number of instances. @@ -132,7 +153,15 @@ var log = logrus.New() func main() { // The API for setting attributes is a little different than the package level // exported logger. See Godoc. - log.Out = os.Stderr + log.Out = os.Stdout + + // You could set this to any `io.Writer` such as a file + // file, err := os.OpenFile("logrus.log", os.O_CREATE|os.O_WRONLY, 0666) + // if err == nil { + // log.Out = file + // } else { + // log.Info("Failed to log to file, using default stderr") + // } log.WithFields(logrus.Fields{ "animal": "walrus", @@ -143,7 +172,7 @@ func main() { #### Fields -Logrus encourages careful, structured logging though logging fields instead of +Logrus encourages careful, structured logging through logging fields instead of long, unparseable error messages. For example, instead of: `log.Fatalf("Failed to send event %s to topic %s with key %d")`, you should log the much more discoverable: @@ -165,6 +194,20 @@ In general, with Logrus using any of the `printf`-family functions should be seen as a hint you should add a field, however, you can still use the `printf`-family functions with Logrus. +#### Default Fields + +Often it's helpful to have fields _always_ attached to log statements in an +application or parts of one. For example, you may want to always log the +`request_id` and `user_ip` in the context of a request. Instead of writing +`log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip})` on +every line, you can create a `logrus.Entry` to pass around instead: + +```go +requestLogger := log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) +requestLogger.Info("something happened on that request") # will log request_id and user_ip +requestLogger.Warn("something not great happened") +``` + #### Hooks You can add hooks for logging levels. For example to send errors to an exception @@ -176,9 +219,9 @@ Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in ```go import ( - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "aibrake" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" + logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" "log/syslog" ) @@ -200,40 +243,52 @@ Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/v | Hook | Description | | ----- | ----------- | -| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. | | [Airbrake "legacy"](https://github.com/gemnasium/logrus-airbrake-legacy-hook) | Send errors to an exception tracking service compatible with the Airbrake API V2. Uses [`airbrake-go`](https://github.com/tobi/airbrake-go) behind the scenes. | -| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. | -| [Syslog](https://github.com/Sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | -| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | -| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. | -| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | -| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | -| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | -| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | -| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) | -| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | -| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | -| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | -| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | -| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | -| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | -| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | -| [Influxus] (http://github.com/vlad-doru/influxus) | Hook for concurrently logging to [InfluxDB] (http://influxdata.com/) | -| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb | -| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit | -| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic | -| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) | +| [Airbrake](https://github.com/gemnasium/logrus-airbrake-hook) | Send errors to the Airbrake API V3. Uses the official [`gobrake`](https://github.com/airbrake/gobrake) behind the scenes. | +| [Amazon Kinesis](https://github.com/evalphobia/logrus_kinesis) | Hook for logging to [Amazon Kinesis](https://aws.amazon.com/kinesis/) | | [Amqp-Hook](https://github.com/vladoatanasov/logrus_amqp) | Hook for logging to Amqp broker (Like RabbitMQ) | -| [KafkaLogrus](https://github.com/goibibo/KafkaLogrus) | Hook for logging to kafka | -| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) | +| [Bugsnag](https://github.com/Shopify/logrus-bugsnag/blob/master/bugsnag.go) | Send errors to the Bugsnag exception tracking service. | +| [DeferPanic](https://github.com/deferpanic/dp-logrus) | Hook for logging to DeferPanic | +| [Discordrus](https://github.com/kz/discordrus) | Hook for logging to [Discord](https://discordapp.com/) | | [ElasticSearch](https://github.com/sohlich/elogrus) | Hook for logging to ElasticSearch| -| [Sumorus](https://github.com/doublefree/sumorus) | Hook for logging to [SumoLogic](https://www.sumologic.com/)| -| [Scribe](https://github.com/sagar8192/logrus-scribe-hook) | Hook for logging to [Scribe](https://github.com/facebookarchive/scribe)| -| [Logstash](https://github.com/bshuster-repo/logrus-logstash-hook) | Hook for logging to [Logstash](https://www.elastic.co/products/logstash) | -| [logz.io](https://github.com/ripcurld00d/logrus-logzio-hook) | Hook for logging to [logz.io](https://logz.io), a Log as a Service using Logstash | +| [Firehose](https://github.com/beaubrewer/logrus_firehose) | Hook for logging to [Amazon Firehose](https://aws.amazon.com/kinesis/firehose/) +| [Fluentd](https://github.com/evalphobia/logrus_fluent) | Hook for logging to fluentd | +| [Go-Slack](https://github.com/multiplay/go-slack) | Hook for logging to [Slack](https://slack.com) | +| [Graylog](https://github.com/gemnasium/logrus-graylog-hook) | Hook for logging to [Graylog](http://graylog2.org/) | +| [Hiprus](https://github.com/nubo/hiprus) | Send errors to a channel in hipchat. | +| [Honeybadger](https://github.com/agonzalezro/logrus_honeybadger) | Hook for sending exceptions to Honeybadger | +| [InfluxDB](https://github.com/Abramovic/logrus_influxdb) | Hook for logging to influxdb | +| [Influxus](http://github.com/vlad-doru/influxus) | Hook for concurrently logging to [InfluxDB](http://influxdata.com/) | +| [Journalhook](https://github.com/wercker/journalhook) | Hook for logging to `systemd-journald` | +| [KafkaLogrus](https://github.com/goibibo/KafkaLogrus) | Hook for logging to kafka | +| [LFShook](https://github.com/rifflock/lfshook) | Hook for logging to the local filesystem | +| [Logentries](https://github.com/jcftang/logentriesrus) | Hook for logging to [Logentries](https://logentries.com/) | +| [Logentrus](https://github.com/puddingfactory/logentrus) | Hook for logging to [Logentries](https://logentries.com/) | | [Logmatic.io](https://github.com/logmatic/logmatic-go) | Hook for logging to [Logmatic.io](http://logmatic.io/) | +| [Logrusly](https://github.com/sebest/logrusly) | Send logs to [Loggly](https://www.loggly.com/) | +| [Logstash](https://github.com/bshuster-repo/logrus-logstash-hook) | Hook for logging to [Logstash](https://www.elastic.co/products/logstash) | +| [Mail](https://github.com/zbindenren/logrus_mail) | Hook for sending exceptions via mail | +| [Mattermost](https://github.com/shuLhan/mattermost-integration/tree/master/hooks/logrus) | Hook for logging to [Mattermost](https://mattermost.com/) | +| [Mongodb](https://github.com/weekface/mgorus) | Hook for logging to mongodb | +| [NATS-Hook](https://github.com/rybit/nats_logrus_hook) | Hook for logging to [NATS](https://nats.io) | +| [Octokit](https://github.com/dorajistyle/logrus-octokit-hook) | Hook for logging to github via octokit | +| [Papertrail](https://github.com/polds/logrus-papertrail-hook) | Send errors to the [Papertrail](https://papertrailapp.com) hosted logging service via UDP. | +| [PostgreSQL](https://github.com/gemnasium/logrus-postgresql-hook) | Send logs to [PostgreSQL](http://postgresql.org) | | [Pushover](https://github.com/toorop/logrus_pushover) | Send error via [Pushover](https://pushover.net) | - +| [Raygun](https://github.com/squirkle/logrus-raygun-hook) | Hook for logging to [Raygun.io](http://raygun.io/) | +| [Redis-Hook](https://github.com/rogierlommers/logrus-redis-hook) | Hook for logging to a ELK stack (through Redis) | +| [Rollrus](https://github.com/heroku/rollrus) | Hook for sending errors to rollbar | +| [Scribe](https://github.com/sagar8192/logrus-scribe-hook) | Hook for logging to [Scribe](https://github.com/facebookarchive/scribe)| +| [Sentry](https://github.com/evalphobia/logrus_sentry) | Send errors to the Sentry error logging and aggregation service. | +| [Slackrus](https://github.com/johntdyer/slackrus) | Hook for Slack chat. | +| [Stackdriver](https://github.com/knq/sdhook) | Hook for logging to [Google Stackdriver](https://cloud.google.com/logging/) | +| [Sumorus](https://github.com/doublefree/sumorus) | Hook for logging to [SumoLogic](https://www.sumologic.com/)| +| [Syslog](https://github.com/sirupsen/logrus/blob/master/hooks/syslog/syslog.go) | Send errors to remote syslog server. Uses standard library `log/syslog` behind the scenes. | +| [Syslog TLS](https://github.com/shinji62/logrus-syslog-ng) | Send errors to remote syslog server with TLS support. | +| [TraceView](https://github.com/evalphobia/logrus_appneta) | Hook for logging to [AppNeta TraceView](https://www.appneta.com/products/traceview/) | +| [Typetalk](https://github.com/dragon3/logrus-typetalk-hook) | Hook for logging to [Typetalk](https://www.typetalk.in/) | +| [logz.io](https://github.com/ripcurld00d/logrus-logzio-hook) | Hook for logging to [logz.io](https://logz.io), a Log as a Service using Logstash | +| [SQS-Hook](https://github.com/tsarpaul/logrus_sqs) | Hook for logging to [Amazon Simple Queue Service (SQS)](https://aws.amazon.com/sqs/) | #### Level logging @@ -282,7 +337,7 @@ could do: ```go import ( - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) init() { @@ -309,8 +364,11 @@ The built-in logging formatters are: without colors. * *Note:* to force colored output when there is no TTY, set the `ForceColors` field to `true`. To force no colored output even if there is a TTY set the - `DisableColors` field to `true` + `DisableColors` field to `true`. For Windows, see + [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). * `logrus.JSONFormatter`. Logs fields as JSON. + * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). Third party logging formatters: @@ -359,6 +417,18 @@ srv := http.Server{ Each line written to that writer will be printed the usual way, using formatters and hooks. The level for those entries is `info`. +This means that we can override the standard library logger easily: + +```go +logger := logrus.New() +logger.Formatter = &logrus.JSONFormatter{} + +// Use logrus for standard log output +// Note that `log` here references stdlib's log +// Not logrus imported under the name `log`. +log.SetOutput(logger.Writer()) +``` + #### Rotation Log rotation is not provided with Logrus. Log rotation should be done by an @@ -370,7 +440,7 @@ entries. It should not be a feature of the application-level logger. | Tool | Description | | ---- | ----------- | |[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will generated with different config at different environment.| -|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper arround Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | +|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | #### Testing @@ -380,15 +450,24 @@ Logrus has a built in facility for asserting the presence of log messages. This * a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): ```go -logger, hook := NewNullLogger() -logger.Error("Hello error") +import( + "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/test" + "github.com/stretchr/testify/assert" + "testing" +) -assert.Equal(1, len(hook.Entries)) -assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level) -assert.Equal("Hello error", hook.LastEntry().Message) +func TestSomething(t*testing.T){ + logger, hook := test.NewNullLogger() + logger.Error("Helloerror") -hook.Reset() -assert.Nil(hook.LastEntry()) + assert.Equal(t, 1, len(hook.Entries)) + assert.Equal(t, logrus.ErrorLevel, hook.LastEntry().Level) + assert.Equal(t, "Helloerror", hook.LastEntry().Message) + + hook.Reset() + assert.Nil(t, hook.LastEntry()) +} ``` #### Fatal handlers @@ -407,7 +486,7 @@ logrus.RegisterExitHandler(handler) ... ``` -#### Thread safty +#### Thread safety By default Logger is protected by mutex for concurrent writes, this mutex is invoked when calling hooks and writing logs. If you are sure such locking is not needed, you can call logger.SetNoLock() to disable the locking. diff --git a/vendor/github.com/Sirupsen/logrus/alt_exit.go b/vendor/github.com/sirupsen/logrus/alt_exit.go similarity index 96% rename from vendor/github.com/Sirupsen/logrus/alt_exit.go rename to vendor/github.com/sirupsen/logrus/alt_exit.go index b4c9e84754..8af90637a9 100644 --- a/vendor/github.com/Sirupsen/logrus/alt_exit.go +++ b/vendor/github.com/sirupsen/logrus/alt_exit.go @@ -1,7 +1,7 @@ package logrus // The following code was sourced and modified from the -// https://bitbucket.org/tebeka/atexit package governed by the following license: +// https://github.com/tebeka/atexit package governed by the following license: // // Copyright (c) 2012 Miki Tebeka . // diff --git a/vendor/github.com/Sirupsen/logrus/doc.go b/vendor/github.com/sirupsen/logrus/doc.go similarity index 83% rename from vendor/github.com/Sirupsen/logrus/doc.go rename to vendor/github.com/sirupsen/logrus/doc.go index dddd5f877b..da67aba06d 100644 --- a/vendor/github.com/Sirupsen/logrus/doc.go +++ b/vendor/github.com/sirupsen/logrus/doc.go @@ -7,7 +7,7 @@ The simplest way to use Logrus is simply the package-level exported logger: package main import ( - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) func main() { @@ -21,6 +21,6 @@ The simplest way to use Logrus is simply the package-level exported logger: Output: time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 -For a full guide visit https://github.com/Sirupsen/logrus +For a full guide visit https://github.com/sirupsen/logrus */ package logrus diff --git a/vendor/github.com/Sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go similarity index 89% rename from vendor/github.com/Sirupsen/logrus/entry.go rename to vendor/github.com/sirupsen/logrus/entry.go index 4edbe7a2de..320e5d5b8b 100644 --- a/vendor/github.com/Sirupsen/logrus/entry.go +++ b/vendor/github.com/sirupsen/logrus/entry.go @@ -126,7 +126,7 @@ func (entry Entry) log(level Level, msg string) { } func (entry *Entry) Debug(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { + if entry.Logger.level() >= DebugLevel { entry.log(DebugLevel, fmt.Sprint(args...)) } } @@ -136,13 +136,13 @@ func (entry *Entry) Print(args ...interface{}) { } func (entry *Entry) Info(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { + if entry.Logger.level() >= InfoLevel { entry.log(InfoLevel, fmt.Sprint(args...)) } } func (entry *Entry) Warn(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { + if entry.Logger.level() >= WarnLevel { entry.log(WarnLevel, fmt.Sprint(args...)) } } @@ -152,20 +152,20 @@ func (entry *Entry) Warning(args ...interface{}) { } func (entry *Entry) Error(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { + if entry.Logger.level() >= ErrorLevel { entry.log(ErrorLevel, fmt.Sprint(args...)) } } func (entry *Entry) Fatal(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { + if entry.Logger.level() >= FatalLevel { entry.log(FatalLevel, fmt.Sprint(args...)) } Exit(1) } func (entry *Entry) Panic(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { + if entry.Logger.level() >= PanicLevel { entry.log(PanicLevel, fmt.Sprint(args...)) } panic(fmt.Sprint(args...)) @@ -174,13 +174,13 @@ func (entry *Entry) Panic(args ...interface{}) { // Entry Printf family functions func (entry *Entry) Debugf(format string, args ...interface{}) { - if entry.Logger.Level >= DebugLevel { + if entry.Logger.level() >= DebugLevel { entry.Debug(fmt.Sprintf(format, args...)) } } func (entry *Entry) Infof(format string, args ...interface{}) { - if entry.Logger.Level >= InfoLevel { + if entry.Logger.level() >= InfoLevel { entry.Info(fmt.Sprintf(format, args...)) } } @@ -190,7 +190,7 @@ func (entry *Entry) Printf(format string, args ...interface{}) { } func (entry *Entry) Warnf(format string, args ...interface{}) { - if entry.Logger.Level >= WarnLevel { + if entry.Logger.level() >= WarnLevel { entry.Warn(fmt.Sprintf(format, args...)) } } @@ -200,20 +200,20 @@ func (entry *Entry) Warningf(format string, args ...interface{}) { } func (entry *Entry) Errorf(format string, args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { + if entry.Logger.level() >= ErrorLevel { entry.Error(fmt.Sprintf(format, args...)) } } func (entry *Entry) Fatalf(format string, args ...interface{}) { - if entry.Logger.Level >= FatalLevel { + if entry.Logger.level() >= FatalLevel { entry.Fatal(fmt.Sprintf(format, args...)) } Exit(1) } func (entry *Entry) Panicf(format string, args ...interface{}) { - if entry.Logger.Level >= PanicLevel { + if entry.Logger.level() >= PanicLevel { entry.Panic(fmt.Sprintf(format, args...)) } } @@ -221,13 +221,13 @@ func (entry *Entry) Panicf(format string, args ...interface{}) { // Entry Println family functions func (entry *Entry) Debugln(args ...interface{}) { - if entry.Logger.Level >= DebugLevel { + if entry.Logger.level() >= DebugLevel { entry.Debug(entry.sprintlnn(args...)) } } func (entry *Entry) Infoln(args ...interface{}) { - if entry.Logger.Level >= InfoLevel { + if entry.Logger.level() >= InfoLevel { entry.Info(entry.sprintlnn(args...)) } } @@ -237,7 +237,7 @@ func (entry *Entry) Println(args ...interface{}) { } func (entry *Entry) Warnln(args ...interface{}) { - if entry.Logger.Level >= WarnLevel { + if entry.Logger.level() >= WarnLevel { entry.Warn(entry.sprintlnn(args...)) } } @@ -247,20 +247,20 @@ func (entry *Entry) Warningln(args ...interface{}) { } func (entry *Entry) Errorln(args ...interface{}) { - if entry.Logger.Level >= ErrorLevel { + if entry.Logger.level() >= ErrorLevel { entry.Error(entry.sprintlnn(args...)) } } func (entry *Entry) Fatalln(args ...interface{}) { - if entry.Logger.Level >= FatalLevel { + if entry.Logger.level() >= FatalLevel { entry.Fatal(entry.sprintlnn(args...)) } Exit(1) } func (entry *Entry) Panicln(args ...interface{}) { - if entry.Logger.Level >= PanicLevel { + if entry.Logger.level() >= PanicLevel { entry.Panic(entry.sprintlnn(args...)) } } diff --git a/vendor/github.com/Sirupsen/logrus/exported.go b/vendor/github.com/sirupsen/logrus/exported.go similarity index 99% rename from vendor/github.com/Sirupsen/logrus/exported.go rename to vendor/github.com/sirupsen/logrus/exported.go index 9a0120ac1d..1aeaa90ba2 100644 --- a/vendor/github.com/Sirupsen/logrus/exported.go +++ b/vendor/github.com/sirupsen/logrus/exported.go @@ -31,14 +31,14 @@ func SetFormatter(formatter Formatter) { func SetLevel(level Level) { std.mu.Lock() defer std.mu.Unlock() - std.Level = level + std.setLevel(level) } // GetLevel returns the standard logger level. func GetLevel() Level { std.mu.Lock() defer std.mu.Unlock() - return std.Level + return std.level() } // AddHook adds a hook to the standard logger hooks. diff --git a/vendor/github.com/Sirupsen/logrus/formatter.go b/vendor/github.com/sirupsen/logrus/formatter.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/formatter.go rename to vendor/github.com/sirupsen/logrus/formatter.go diff --git a/vendor/github.com/Sirupsen/logrus/hooks.go b/vendor/github.com/sirupsen/logrus/hooks.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/hooks.go rename to vendor/github.com/sirupsen/logrus/hooks.go diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go new file mode 100644 index 0000000000..e787ea1750 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/json_formatter.go @@ -0,0 +1,74 @@ +package logrus + +import ( + "encoding/json" + "fmt" +) + +type fieldKey string +type FieldMap map[fieldKey]string + +const ( + FieldKeyMsg = "msg" + FieldKeyLevel = "level" + FieldKeyTime = "time" +) + +func (f FieldMap) resolve(key fieldKey) string { + if k, ok := f[key]; ok { + return k + } + + return string(key) +} + +type JSONFormatter struct { + // TimestampFormat sets the format used for marshaling timestamps. + TimestampFormat string + + // DisableTimestamp allows disabling automatic timestamps in output + DisableTimestamp bool + + // FieldMap allows users to customize the names of keys for various fields. + // As an example: + // formatter := &JSONFormatter{ + // FieldMap: FieldMap{ + // FieldKeyTime: "@timestamp", + // FieldKeyLevel: "@level", + // FieldKeyMsg: "@message", + // }, + // } + FieldMap FieldMap +} + +func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { + data := make(Fields, len(entry.Data)+3) + for k, v := range entry.Data { + switch v := v.(type) { + case error: + // Otherwise errors are ignored by `encoding/json` + // https://github.com/sirupsen/logrus/issues/137 + data[k] = v.Error() + default: + data[k] = v + } + } + prefixFieldClashes(data) + + timestampFormat := f.TimestampFormat + if timestampFormat == "" { + timestampFormat = DefaultTimestampFormat + } + + if !f.DisableTimestamp { + data[f.FieldMap.resolve(FieldKeyTime)] = entry.Time.Format(timestampFormat) + } + data[f.FieldMap.resolve(FieldKeyMsg)] = entry.Message + data[f.FieldMap.resolve(FieldKeyLevel)] = entry.Level.String() + + serialized, err := json.Marshal(data) + if err != nil { + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + } + return append(serialized, '\n'), nil +} diff --git a/vendor/github.com/Sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go similarity index 88% rename from vendor/github.com/Sirupsen/logrus/logger.go rename to vendor/github.com/sirupsen/logrus/logger.go index b769f3d352..370fff5d1b 100644 --- a/vendor/github.com/Sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -4,6 +4,7 @@ import ( "io" "os" "sync" + "sync/atomic" ) type Logger struct { @@ -112,7 +113,7 @@ func (logger *Logger) WithError(err error) *Entry { } func (logger *Logger) Debugf(format string, args ...interface{}) { - if logger.Level >= DebugLevel { + if logger.level() >= DebugLevel { entry := logger.newEntry() entry.Debugf(format, args...) logger.releaseEntry(entry) @@ -120,7 +121,7 @@ func (logger *Logger) Debugf(format string, args ...interface{}) { } func (logger *Logger) Infof(format string, args ...interface{}) { - if logger.Level >= InfoLevel { + if logger.level() >= InfoLevel { entry := logger.newEntry() entry.Infof(format, args...) logger.releaseEntry(entry) @@ -134,7 +135,7 @@ func (logger *Logger) Printf(format string, args ...interface{}) { } func (logger *Logger) Warnf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warnf(format, args...) logger.releaseEntry(entry) @@ -142,7 +143,7 @@ func (logger *Logger) Warnf(format string, args ...interface{}) { } func (logger *Logger) Warningf(format string, args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warnf(format, args...) logger.releaseEntry(entry) @@ -150,7 +151,7 @@ func (logger *Logger) Warningf(format string, args ...interface{}) { } func (logger *Logger) Errorf(format string, args ...interface{}) { - if logger.Level >= ErrorLevel { + if logger.level() >= ErrorLevel { entry := logger.newEntry() entry.Errorf(format, args...) logger.releaseEntry(entry) @@ -158,7 +159,7 @@ func (logger *Logger) Errorf(format string, args ...interface{}) { } func (logger *Logger) Fatalf(format string, args ...interface{}) { - if logger.Level >= FatalLevel { + if logger.level() >= FatalLevel { entry := logger.newEntry() entry.Fatalf(format, args...) logger.releaseEntry(entry) @@ -167,7 +168,7 @@ func (logger *Logger) Fatalf(format string, args ...interface{}) { } func (logger *Logger) Panicf(format string, args ...interface{}) { - if logger.Level >= PanicLevel { + if logger.level() >= PanicLevel { entry := logger.newEntry() entry.Panicf(format, args...) logger.releaseEntry(entry) @@ -175,7 +176,7 @@ func (logger *Logger) Panicf(format string, args ...interface{}) { } func (logger *Logger) Debug(args ...interface{}) { - if logger.Level >= DebugLevel { + if logger.level() >= DebugLevel { entry := logger.newEntry() entry.Debug(args...) logger.releaseEntry(entry) @@ -183,7 +184,7 @@ func (logger *Logger) Debug(args ...interface{}) { } func (logger *Logger) Info(args ...interface{}) { - if logger.Level >= InfoLevel { + if logger.level() >= InfoLevel { entry := logger.newEntry() entry.Info(args...) logger.releaseEntry(entry) @@ -197,7 +198,7 @@ func (logger *Logger) Print(args ...interface{}) { } func (logger *Logger) Warn(args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warn(args...) logger.releaseEntry(entry) @@ -205,7 +206,7 @@ func (logger *Logger) Warn(args ...interface{}) { } func (logger *Logger) Warning(args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warn(args...) logger.releaseEntry(entry) @@ -213,7 +214,7 @@ func (logger *Logger) Warning(args ...interface{}) { } func (logger *Logger) Error(args ...interface{}) { - if logger.Level >= ErrorLevel { + if logger.level() >= ErrorLevel { entry := logger.newEntry() entry.Error(args...) logger.releaseEntry(entry) @@ -221,7 +222,7 @@ func (logger *Logger) Error(args ...interface{}) { } func (logger *Logger) Fatal(args ...interface{}) { - if logger.Level >= FatalLevel { + if logger.level() >= FatalLevel { entry := logger.newEntry() entry.Fatal(args...) logger.releaseEntry(entry) @@ -230,7 +231,7 @@ func (logger *Logger) Fatal(args ...interface{}) { } func (logger *Logger) Panic(args ...interface{}) { - if logger.Level >= PanicLevel { + if logger.level() >= PanicLevel { entry := logger.newEntry() entry.Panic(args...) logger.releaseEntry(entry) @@ -238,7 +239,7 @@ func (logger *Logger) Panic(args ...interface{}) { } func (logger *Logger) Debugln(args ...interface{}) { - if logger.Level >= DebugLevel { + if logger.level() >= DebugLevel { entry := logger.newEntry() entry.Debugln(args...) logger.releaseEntry(entry) @@ -246,7 +247,7 @@ func (logger *Logger) Debugln(args ...interface{}) { } func (logger *Logger) Infoln(args ...interface{}) { - if logger.Level >= InfoLevel { + if logger.level() >= InfoLevel { entry := logger.newEntry() entry.Infoln(args...) logger.releaseEntry(entry) @@ -260,7 +261,7 @@ func (logger *Logger) Println(args ...interface{}) { } func (logger *Logger) Warnln(args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warnln(args...) logger.releaseEntry(entry) @@ -268,7 +269,7 @@ func (logger *Logger) Warnln(args ...interface{}) { } func (logger *Logger) Warningln(args ...interface{}) { - if logger.Level >= WarnLevel { + if logger.level() >= WarnLevel { entry := logger.newEntry() entry.Warnln(args...) logger.releaseEntry(entry) @@ -276,7 +277,7 @@ func (logger *Logger) Warningln(args ...interface{}) { } func (logger *Logger) Errorln(args ...interface{}) { - if logger.Level >= ErrorLevel { + if logger.level() >= ErrorLevel { entry := logger.newEntry() entry.Errorln(args...) logger.releaseEntry(entry) @@ -284,7 +285,7 @@ func (logger *Logger) Errorln(args ...interface{}) { } func (logger *Logger) Fatalln(args ...interface{}) { - if logger.Level >= FatalLevel { + if logger.level() >= FatalLevel { entry := logger.newEntry() entry.Fatalln(args...) logger.releaseEntry(entry) @@ -293,7 +294,7 @@ func (logger *Logger) Fatalln(args ...interface{}) { } func (logger *Logger) Panicln(args ...interface{}) { - if logger.Level >= PanicLevel { + if logger.level() >= PanicLevel { entry := logger.newEntry() entry.Panicln(args...) logger.releaseEntry(entry) @@ -306,3 +307,11 @@ func (logger *Logger) Panicln(args ...interface{}) { func (logger *Logger) SetNoLock() { logger.mu.Disable() } + +func (logger *Logger) level() Level { + return Level(atomic.LoadUint32((*uint32)(&logger.Level))) +} + +func (logger *Logger) setLevel(level Level) { + atomic.StoreUint32((*uint32)(&logger.Level), uint32(level)) +} diff --git a/vendor/github.com/Sirupsen/logrus/logrus.go b/vendor/github.com/sirupsen/logrus/logrus.go similarity index 99% rename from vendor/github.com/Sirupsen/logrus/logrus.go rename to vendor/github.com/sirupsen/logrus/logrus.go index e596691116..dd38999741 100644 --- a/vendor/github.com/Sirupsen/logrus/logrus.go +++ b/vendor/github.com/sirupsen/logrus/logrus.go @@ -10,7 +10,7 @@ import ( type Fields map[string]interface{} // Level type -type Level uint8 +type Level uint32 // Convert the Level to a string. E.g. PanicLevel becomes "panic". func (level Level) String() string { diff --git a/vendor/github.com/Sirupsen/logrus/terminal_appengine.go b/vendor/github.com/sirupsen/logrus/terminal_appengine.go similarity index 71% rename from vendor/github.com/Sirupsen/logrus/terminal_appengine.go rename to vendor/github.com/sirupsen/logrus/terminal_appengine.go index 1960169ef2..e011a86945 100644 --- a/vendor/github.com/Sirupsen/logrus/terminal_appengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_appengine.go @@ -2,7 +2,9 @@ package logrus +import "io" + // IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { +func IsTerminal(f io.Writer) bool { return true } diff --git a/vendor/github.com/Sirupsen/logrus/terminal_bsd.go b/vendor/github.com/sirupsen/logrus/terminal_bsd.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_bsd.go rename to vendor/github.com/sirupsen/logrus/terminal_bsd.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_linux.go b/vendor/github.com/sirupsen/logrus/terminal_linux.go similarity index 100% rename from vendor/github.com/Sirupsen/logrus/terminal_linux.go rename to vendor/github.com/sirupsen/logrus/terminal_linux.go diff --git a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/sirupsen/logrus/terminal_notwindows.go similarity index 60% rename from vendor/github.com/Sirupsen/logrus/terminal_notwindows.go rename to vendor/github.com/sirupsen/logrus/terminal_notwindows.go index 329038f6ca..190297abf3 100644 --- a/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go +++ b/vendor/github.com/sirupsen/logrus/terminal_notwindows.go @@ -9,14 +9,20 @@ package logrus import ( + "io" + "os" "syscall" "unsafe" ) // IsTerminal returns true if stderr's file descriptor is a terminal. -func IsTerminal() bool { - fd := syscall.Stderr +func IsTerminal(f io.Writer) bool { var termios Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 + switch v := f.(type) { + case *os.File: + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(v.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 + default: + return false + } } diff --git a/vendor/github.com/sirupsen/logrus/terminal_solaris.go b/vendor/github.com/sirupsen/logrus/terminal_solaris.go new file mode 100644 index 0000000000..3c86b1abee --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/terminal_solaris.go @@ -0,0 +1,21 @@ +// +build solaris,!appengine + +package logrus + +import ( + "io" + "os" + + "golang.org/x/sys/unix" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal(f io.Writer) bool { + switch v := f.(type) { + case *os.File: + _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA) + return err == nil + default: + return false + } +} diff --git a/vendor/github.com/sirupsen/logrus/terminal_windows.go b/vendor/github.com/sirupsen/logrus/terminal_windows.go new file mode 100644 index 0000000000..7a336307e5 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/terminal_windows.go @@ -0,0 +1,82 @@ +// Based on ssh/terminal: +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows,!appengine + +package logrus + +import ( + "bytes" + "errors" + "io" + "os" + "os/exec" + "strconv" + "strings" + "syscall" + "unsafe" +) + +var kernel32 = syscall.NewLazyDLL("kernel32.dll") + +var ( + procGetConsoleMode = kernel32.NewProc("GetConsoleMode") + procSetConsoleMode = kernel32.NewProc("SetConsoleMode") +) + +const ( + enableProcessedOutput = 0x0001 + enableWrapAtEolOutput = 0x0002 + enableVirtualTerminalProcessing = 0x0004 +) + +func getVersion() (float64, error) { + stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} + cmd := exec.Command("cmd", "ver") + cmd.Stdout = stdout + cmd.Stderr = stderr + err := cmd.Run() + if err != nil { + return -1, err + } + + // The output should be like "Microsoft Windows [Version XX.X.XXXXXX]" + version := strings.Replace(stdout.String(), "\n", "", -1) + version = strings.Replace(version, "\r\n", "", -1) + + x1 := strings.Index(version, "[Version") + + if x1 == -1 || strings.Index(version, "]") == -1 { + return -1, errors.New("Can't determine Windows version") + } + + return strconv.ParseFloat(version[x1+9:x1+13], 64) +} + +func init() { + ver, err := getVersion() + if err != nil { + return + } + + // Activate Virtual Processing for Windows CMD + // Info: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx + if ver >= 10 { + handle := syscall.Handle(os.Stderr.Fd()) + procSetConsoleMode.Call(uintptr(handle), enableProcessedOutput|enableWrapAtEolOutput|enableVirtualTerminalProcessing) + } +} + +// IsTerminal returns true if stderr's file descriptor is a terminal. +func IsTerminal(f io.Writer) bool { + switch v := f.(type) { + case *os.File: + var st uint32 + r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(v.Fd()), uintptr(unsafe.Pointer(&st)), 0) + return r != 0 && e == 0 + default: + return false + } +} diff --git a/vendor/github.com/Sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go similarity index 69% rename from vendor/github.com/Sirupsen/logrus/text_formatter.go rename to vendor/github.com/sirupsen/logrus/text_formatter.go index 9114b3ca47..26dcc15538 100644 --- a/vendor/github.com/Sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -3,9 +3,9 @@ package logrus import ( "bytes" "fmt" - "runtime" "sort" "strings" + "sync" "time" ) @@ -20,16 +20,10 @@ const ( var ( baseTimestamp time.Time - isTerminal bool ) func init() { baseTimestamp = time.Now() - isTerminal = IsTerminal() -} - -func miniTS() int { - return int(time.Since(baseTimestamp) / time.Second) } type TextFormatter struct { @@ -54,11 +48,32 @@ type TextFormatter struct { // that log extremely frequently and don't use the JSON formatter this may not // be desired. DisableSorting bool + + // QuoteEmptyFields will wrap empty fields in quotes if true + QuoteEmptyFields bool + + // QuoteCharacter can be set to the override the default quoting character " + // with something else. For example: ', or `. + QuoteCharacter string + + // Whether the logger's out is to a terminal + isTerminal bool + + sync.Once +} + +func (f *TextFormatter) init(entry *Entry) { + if len(f.QuoteCharacter) == 0 { + f.QuoteCharacter = "\"" + } + if entry.Logger != nil { + f.isTerminal = IsTerminal(entry.Logger.Out) + } } func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { var b *bytes.Buffer - var keys []string = make([]string, 0, len(entry.Data)) + keys := make([]string, 0, len(entry.Data)) for k := range entry.Data { keys = append(keys, k) } @@ -74,8 +89,9 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { prefixFieldClashes(entry.Data) - isColorTerminal := isTerminal && (runtime.GOOS != "windows") - isColored := (f.ForceColors || isColorTerminal) && !f.DisableColors + f.Do(func() { f.init(entry) }) + + isColored := (f.ForceColors || f.isTerminal) && !f.DisableColors timestampFormat := f.TimestampFormat if timestampFormat == "" { @@ -115,8 +131,10 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin levelText := strings.ToUpper(entry.Level.String())[0:4] - if !f.FullTimestamp { - fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, miniTS(), entry.Message) + if f.DisableTimestamp { + fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m %-44s ", levelColor, levelText, entry.Message) + } else if !f.FullTimestamp { + fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%04d] %-44s ", levelColor, levelText, int(entry.Time.Sub(baseTimestamp)/time.Second), entry.Message) } else { fmt.Fprintf(b, "\x1b[%dm%s\x1b[0m[%s] %-44s ", levelColor, levelText, entry.Time.Format(timestampFormat), entry.Message) } @@ -127,7 +145,10 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin } } -func needsQuoting(text string) bool { +func (f *TextFormatter) needsQuoting(text string) bool { + if f.QuoteEmptyFields && len(text) == 0 { + return true + } for _, ch := range text { if !((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || @@ -150,19 +171,26 @@ func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interf func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { switch value := value.(type) { case string: - if !needsQuoting(value) { + if !f.needsQuoting(value) { b.WriteString(value) } else { - fmt.Fprintf(b, "%q", value) + b.WriteString(f.quoteString(value)) } case error: errmsg := value.Error() - if !needsQuoting(errmsg) { + if !f.needsQuoting(errmsg) { b.WriteString(errmsg) } else { - fmt.Fprintf(b, "%q", errmsg) + b.WriteString(f.quoteString(errmsg)) } default: fmt.Fprint(b, value) } } + +func (f *TextFormatter) quoteString(v string) string { + escapedQuote := fmt.Sprintf("\\%s", f.QuoteCharacter) + escapedValue := strings.Replace(v, f.QuoteCharacter, escapedQuote, -1) + + return fmt.Sprintf("%s%v%s", f.QuoteCharacter, escapedValue, f.QuoteCharacter) +} diff --git a/vendor/github.com/Sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go similarity index 54% rename from vendor/github.com/Sirupsen/logrus/writer.go rename to vendor/github.com/sirupsen/logrus/writer.go index f74d2aa5fc..7bdebedc60 100644 --- a/vendor/github.com/Sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -11,39 +11,48 @@ func (logger *Logger) Writer() *io.PipeWriter { } func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { + return NewEntry(logger).WriterLevel(level) +} + +func (entry *Entry) Writer() *io.PipeWriter { + return entry.WriterLevel(InfoLevel) +} + +func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() var printFunc func(args ...interface{}) + switch level { case DebugLevel: - printFunc = logger.Debug + printFunc = entry.Debug case InfoLevel: - printFunc = logger.Info + printFunc = entry.Info case WarnLevel: - printFunc = logger.Warn + printFunc = entry.Warn case ErrorLevel: - printFunc = logger.Error + printFunc = entry.Error case FatalLevel: - printFunc = logger.Fatal + printFunc = entry.Fatal case PanicLevel: - printFunc = logger.Panic + printFunc = entry.Panic default: - printFunc = logger.Print + printFunc = entry.Print } - go logger.writerScanner(reader, printFunc) + go entry.writerScanner(reader, printFunc) runtime.SetFinalizer(writer, writerFinalizer) return writer } -func (logger *Logger) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { +func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { scanner := bufio.NewScanner(reader) for scanner.Scan() { printFunc(scanner.Text()) } if err := scanner.Err(); err != nil { - logger.Errorf("Error while reading from Writer: %s", err) + entry.Errorf("Error while reading from Writer: %s", err) } reader.Close() } diff --git a/volume/drivers/adapter.go b/volume/drivers/adapter.go index 304c81bc00..54d1ff2630 100644 --- a/volume/drivers/adapter.go +++ b/volume/drivers/adapter.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/Sirupsen/logrus" "github.com/docker/docker/volume" + "github.com/sirupsen/logrus" ) var ( diff --git a/volume/local/local.go b/volume/local/local.go index 43ba1e1db7..329febb4d7 100644 --- a/volume/local/local.go +++ b/volume/local/local.go @@ -15,11 +15,11 @@ import ( "github.com/pkg/errors" - "github.com/Sirupsen/logrus" "github.com/docker/docker/api" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/mount" "github.com/docker/docker/volume" + "github.com/sirupsen/logrus" ) // VolumeDataPathName is the name of the directory where the volume data is stored. diff --git a/volume/store/db.go b/volume/store/db.go index c5fd1643f5..01f0abb238 100644 --- a/volume/store/db.go +++ b/volume/store/db.go @@ -3,9 +3,9 @@ package store import ( "encoding/json" - "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) var volumeBucketName = []byte("volumes") diff --git a/volume/store/restore.go b/volume/store/restore.go index c0c5b519bc..e2a72a6551 100644 --- a/volume/store/restore.go +++ b/volume/store/restore.go @@ -3,10 +3,10 @@ package store import ( "sync" - "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/docker/docker/volume" "github.com/docker/docker/volume/drivers" + "github.com/sirupsen/logrus" ) // restore is called when a new volume store is created. diff --git a/volume/store/store.go b/volume/store/store.go index cded883e6e..b1742061bb 100644 --- a/volume/store/store.go +++ b/volume/store/store.go @@ -9,11 +9,11 @@ import ( "github.com/pkg/errors" - "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/docker/docker/pkg/locker" "github.com/docker/docker/volume" "github.com/docker/docker/volume/drivers" + "github.com/sirupsen/logrus" ) const (