From 98b446c7e76c5326de3a6c72a0653cfba5f0e85b Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Wed, 2 Mar 2022 15:53:54 -0300 Subject: [PATCH] chore: update to go-log@v2 --- cmd/ipfs/main.go | 6 ++--- cmd/ipfs/pinmfs.go | 2 +- cmd/ipfs/util/ulimit.go | 2 +- commands/context.go | 2 +- core/bootstrap/bootstrap.go | 2 +- core/commands/cmdenv/env.go | 2 +- core/commands/files.go | 2 +- core/commands/log.go | 32 ++++++++++++++++++-------- core/commands/name/ipns.go | 2 +- core/commands/pin/remotepin.go | 2 +- core/commands/root.go | 2 +- core/core.go | 2 +- core/corehttp/corehttp.go | 2 +- core/corehttp/logs.go | 32 +++++++++++++++++++++++--- core/corerepo/gc.go | 2 +- core/coreunix/add.go | 2 +- core/node/groups.go | 2 +- core/node/libp2p/libp2p.go | 2 +- fuse/ipns/ipns_unix.go | 2 +- fuse/mount/mount.go | 2 +- fuse/node/mount_unix.go | 2 +- fuse/readonly/readonly_unix.go | 2 +- gc/gc.go | 2 +- go.mod | 3 +-- go.sum | 8 +++++-- p2p/p2p.go | 2 +- peering/peering.go | 2 +- plugin/loader/loader.go | 2 +- plugin/plugins/peerlog/peerlog.go | 2 +- repo/fsrepo/fsrepo.go | 2 +- tar/format.go | 2 +- test/dependencies/pollEndpoint/main.go | 2 +- test/integration/addcat_test.go | 2 +- 33 files changed, 89 insertions(+), 48 deletions(-) diff --git a/cmd/ipfs/main.go b/cmd/ipfs/main.go index d975d18971f..12e9b8f3404 100644 --- a/cmd/ipfs/main.go +++ b/cmd/ipfs/main.go @@ -26,8 +26,7 @@ import ( cmdhttp "github.com/ipfs/go-ipfs-cmds/http" config "github.com/ipfs/go-ipfs-config" u "github.com/ipfs/go-ipfs-util" - logging "github.com/ipfs/go-log" - loggables "github.com/libp2p/go-libp2p-loggables" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" madns "github.com/multiformats/go-multiaddr-dns" manet "github.com/multiformats/go-multiaddr/net" @@ -73,7 +72,6 @@ func main() { func mainRet() int { rand.Seed(time.Now().UnixNano()) - ctx := logging.ContextWithLoggable(context.Background(), loggables.Uuid("session")) var err error // we'll call this local helper to output errors. @@ -89,7 +87,7 @@ func mainRet() int { } defer stopFunc() // to be executed as late as possible - intrh, ctx := util.SetupInterruptHandler(ctx) + intrh, ctx := util.SetupInterruptHandler(context.Background()) defer intrh.Close() // Handle `ipfs version` or `ipfs help` diff --git a/cmd/ipfs/pinmfs.go b/cmd/ipfs/pinmfs.go index 8ea9d2dcc8e..ae3b0c6da34 100644 --- a/cmd/ipfs/pinmfs.go +++ b/cmd/ipfs/pinmfs.go @@ -10,7 +10,7 @@ import ( cid "github.com/ipfs/go-cid" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" pinclient "github.com/ipfs/go-pinning-service-http-client" config "github.com/ipfs/go-ipfs-config" diff --git a/cmd/ipfs/util/ulimit.go b/cmd/ipfs/util/ulimit.go index e024ced8439..b36919b2d27 100644 --- a/cmd/ipfs/util/ulimit.go +++ b/cmd/ipfs/util/ulimit.go @@ -6,7 +6,7 @@ import ( "strconv" "syscall" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ) var log = logging.Logger("ulimit") diff --git a/commands/context.go b/commands/context.go index e43672eee49..832a63566d6 100644 --- a/commands/context.go +++ b/commands/context.go @@ -12,7 +12,7 @@ import ( cmds "github.com/ipfs/go-ipfs-cmds" config "github.com/ipfs/go-ipfs-config" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" coreiface "github.com/ipfs/interface-go-ipfs-core" options "github.com/ipfs/interface-go-ipfs-core/options" ) diff --git a/core/bootstrap/bootstrap.go b/core/bootstrap/bootstrap.go index 4edc5ac840e..07156fee6eb 100644 --- a/core/bootstrap/bootstrap.go +++ b/core/bootstrap/bootstrap.go @@ -9,7 +9,7 @@ import ( "sync" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/jbenet/goprocess" "github.com/jbenet/goprocess/context" "github.com/jbenet/goprocess/periodic" diff --git a/core/commands/cmdenv/env.go b/core/commands/cmdenv/env.go index c21612c3305..d3b57377eee 100644 --- a/core/commands/cmdenv/env.go +++ b/core/commands/cmdenv/env.go @@ -10,7 +10,7 @@ import ( cmds "github.com/ipfs/go-ipfs-cmds" config "github.com/ipfs/go-ipfs-config" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" coreiface "github.com/ipfs/interface-go-ipfs-core" options "github.com/ipfs/interface-go-ipfs-core/options" ) diff --git a/core/commands/files.go b/core/commands/files.go index 879f1fab10e..f75171a34a7 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -20,7 +20,7 @@ import ( cmds "github.com/ipfs/go-ipfs-cmds" offline "github.com/ipfs/go-ipfs-exchange-offline" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" dag "github.com/ipfs/go-merkledag" mfs "github.com/ipfs/go-mfs" ft "github.com/ipfs/go-unixfs" diff --git a/core/commands/log.go b/core/commands/log.go index 78ff8a6b50f..61d5e5acfcc 100644 --- a/core/commands/log.go +++ b/core/commands/log.go @@ -5,8 +5,7 @@ import ( "io" cmds "github.com/ipfs/go-ipfs-cmds" - logging "github.com/ipfs/go-log" - lwriter "github.com/ipfs/go-log/writer" + logging "github.com/ipfs/go-log/v2" ) // Golang os.Args overrides * and replaces the character argument with @@ -104,6 +103,8 @@ subsystems of a running daemon. Type: stringList{}, } +const logLevelOption = "log-level" + var logTailCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Read the event log.", @@ -111,15 +112,28 @@ var logTailCmd = &cmds.Command{ Outputs event log messages (not other log messages) as they are generated. `, }, - + Options: []cmds.Option{ + // FIXME: The PipeReader doesn't support per-subsystem log levels like + // https://github.com/ipfs/go-log#golog_log_level, just a global one. + cmds.StringOption(logLevelOption, "Log level to listen to.").WithDefault(""), + }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - ctx := req.Context - r, w := io.Pipe() + var pipeReader *logging.PipeReader + logLevelString, _ := req.Options[logLevelOption].(string) + if logLevelString != "" { + logLevel, err := logging.LevelFromString(logLevelString) + if err != nil { + return fmt.Errorf("setting log level %s: %w", logLevelString, err) + } + pipeReader = logging.NewPipeReader(logging.PipeLevel(logLevel)) + } else { + pipeReader = logging.NewPipeReader() + } + go func() { - defer w.Close() - <-ctx.Done() + defer pipeReader.Close() + <-req.Context.Done() }() - lwriter.WriterGroup.AddWriter(w) - return res.Emit(r) + return res.Emit(pipeReader) }, } diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 885c469247a..834b44562ae 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -11,7 +11,7 @@ import ( namesys "github.com/ipfs/go-namesys" cmds "github.com/ipfs/go-ipfs-cmds" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" path "github.com/ipfs/go-path" options "github.com/ipfs/interface-go-ipfs-core/options" nsopts "github.com/ipfs/interface-go-ipfs-core/options/namesys" diff --git a/core/commands/pin/remotepin.go b/core/commands/pin/remotepin.go index 0e4bf373ee0..bce8e96e0cd 100644 --- a/core/commands/pin/remotepin.go +++ b/core/commands/pin/remotepin.go @@ -20,7 +20,7 @@ import ( config "github.com/ipfs/go-ipfs-config" "github.com/ipfs/go-ipfs/core/commands/cmdenv" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" pinclient "github.com/ipfs/go-pinning-service-http-client" path "github.com/ipfs/interface-go-ipfs-core/path" "github.com/libp2p/go-libp2p-core/host" diff --git a/core/commands/root.go b/core/commands/root.go index 64b9b42fbf0..db4f0a31bf7 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -11,7 +11,7 @@ import ( unixfs "github.com/ipfs/go-ipfs/core/commands/unixfs" cmds "github.com/ipfs/go-ipfs-cmds" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ) var log = logging.Logger("core/commands") diff --git a/core/core.go b/core/core.go index 888d3d78013..c157d46c7cc 100644 --- a/core/core.go +++ b/core/core.go @@ -23,7 +23,7 @@ import ( exchange "github.com/ipfs/go-ipfs-exchange-interface" "github.com/ipfs/go-ipfs-provider" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" mfs "github.com/ipfs/go-mfs" goprocess "github.com/jbenet/goprocess" connmgr "github.com/libp2p/go-libp2p-core/connmgr" diff --git a/core/corehttp/corehttp.go b/core/corehttp/corehttp.go index 143327149c3..5f8f57bddd1 100644 --- a/core/corehttp/corehttp.go +++ b/core/corehttp/corehttp.go @@ -12,7 +12,7 @@ import ( "time" core "github.com/ipfs/go-ipfs/core" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/jbenet/goprocess" periodicproc "github.com/jbenet/goprocess/periodic" ma "github.com/multiformats/go-multiaddr" diff --git a/core/corehttp/logs.go b/core/corehttp/logs.go index 99e8fa8853b..232279a5508 100644 --- a/core/corehttp/logs.go +++ b/core/corehttp/logs.go @@ -1,12 +1,14 @@ package corehttp import ( + "bytes" "io" "net" "net/http" core "github.com/ipfs/go-ipfs/core" - lwriter "github.com/ipfs/go-log/writer" + + logging "github.com/ipfs/go-log/v2" ) type writeErrNotifier struct { @@ -49,8 +51,32 @@ func LogOption() ServeOption { mux.HandleFunc("/logs", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) wnf, errs := newWriteErrNotifier(w) - lwriter.WriterGroup.AddWriter(wnf) - log.Event(n.Context(), "log API client connected") //nolint deprecated + + // FIXME(BLOCKING): This is a brittle solution and needs careful review. + // Ideally we should use an io.Pipe or similar, but in contrast + // with go-log@v1 where the driver was an io.Writer, here the log + // comes from an io.Reader, and we need to constantly read from it + // and then write to the HTTP response. + pipeReader := logging.NewPipeReader() + b := new(bytes.Buffer) + go func() { + for { + // FIXME: We are not handling read errors. + // FIXME: We may block on read and not catch the context + // cancellation. + b.ReadFrom(pipeReader) + b.WriteTo(wnf) + select { + case <-r.Context().Done(): + return + default: + } + } + }() + + // FIXME(BLOCKING): Verify this call replacing the `Event` API + // which has been removed in go-log v2. + log.Debugf("log API client connected") <-errs }) return mux, nil diff --git a/core/corerepo/gc.go b/core/corerepo/gc.go index 5db45bf477d..bffab3e2804 100644 --- a/core/corerepo/gc.go +++ b/core/corerepo/gc.go @@ -12,7 +12,7 @@ import ( "github.com/dustin/go-humanize" "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/ipfs/go-mfs" ) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 387a977784d..357725c8504 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -15,7 +15,7 @@ import ( pin "github.com/ipfs/go-ipfs-pinner" posinfo "github.com/ipfs/go-ipfs-posinfo" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" dag "github.com/ipfs/go-merkledag" "github.com/ipfs/go-mfs" "github.com/ipfs/go-unixfs" diff --git a/core/node/groups.go b/core/node/groups.go index 80367156e55..83162134bd6 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -9,7 +9,7 @@ import ( blockstore "github.com/ipfs/go-ipfs-blockstore" config "github.com/ipfs/go-ipfs-config" util "github.com/ipfs/go-ipfs-util" - "github.com/ipfs/go-log" + "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/peer" pubsub "github.com/libp2p/go-libp2p-pubsub" diff --git a/core/node/libp2p/libp2p.go b/core/node/libp2p/libp2p.go index 309490bdc52..23b678595b8 100644 --- a/core/node/libp2p/libp2p.go +++ b/core/node/libp2p/libp2p.go @@ -8,7 +8,7 @@ import ( version "github.com/ipfs/go-ipfs" config "github.com/ipfs/go-ipfs-config" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p" connmgr "github.com/libp2p/go-libp2p-connmgr" "github.com/libp2p/go-libp2p-core/crypto" diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index b8caf0ca2fe..1ef30e9163c 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -19,7 +19,7 @@ import ( fuse "bazil.org/fuse" fs "bazil.org/fuse/fs" cid "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" mfs "github.com/ipfs/go-mfs" iface "github.com/ipfs/interface-go-ipfs-core" options "github.com/ipfs/interface-go-ipfs-core/options" diff --git a/fuse/mount/mount.go b/fuse/mount/mount.go index 52784a16d27..85b359b72ef 100644 --- a/fuse/mount/mount.go +++ b/fuse/mount/mount.go @@ -8,7 +8,7 @@ import ( "runtime" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" goprocess "github.com/jbenet/goprocess" ) diff --git a/fuse/node/mount_unix.go b/fuse/node/mount_unix.go index 5388333ac78..44fcf0ca418 100644 --- a/fuse/node/mount_unix.go +++ b/fuse/node/mount_unix.go @@ -13,7 +13,7 @@ import ( mount "github.com/ipfs/go-ipfs/fuse/mount" rofs "github.com/ipfs/go-ipfs/fuse/readonly" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ) var log = logging.Logger("node") diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index 1fbb473106d..05c0d40450b 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -16,7 +16,7 @@ import ( "github.com/ipfs/go-cid" core "github.com/ipfs/go-ipfs/core" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" mdag "github.com/ipfs/go-merkledag" path "github.com/ipfs/go-path" "github.com/ipfs/go-path/resolver" diff --git a/gc/gc.go b/gc/gc.go index a77142e103a..6321321f8cc 100644 --- a/gc/gc.go +++ b/gc/gc.go @@ -14,7 +14,7 @@ import ( offline "github.com/ipfs/go-ipfs-exchange-offline" pin "github.com/ipfs/go-ipfs-pinner" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" dag "github.com/ipfs/go-merkledag" "github.com/ipfs/go-verifcid" ) diff --git a/go.mod b/go.mod index 8546b9057b3..aa031024313 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/ipfs/go-ipld-git v0.1.1 github.com/ipfs/go-ipld-legacy v0.1.0 github.com/ipfs/go-ipns v0.1.2 - github.com/ipfs/go-log v1.0.5 + github.com/ipfs/go-log/v2 v2.5.0 github.com/ipfs/go-merkledag v0.5.1 github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 @@ -73,7 +73,6 @@ require ( github.com/libp2p/go-libp2p-http v0.2.1 github.com/libp2p/go-libp2p-kad-dht v0.15.0 github.com/libp2p/go-libp2p-kbucket v0.4.7 - github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 github.com/libp2p/go-libp2p-noise v0.3.0 github.com/libp2p/go-libp2p-peerstore v0.4.0 diff --git a/go.sum b/go.sum index e791d5ea3cf..dc2061ca01c 100644 --- a/go.sum +++ b/go.sum @@ -539,8 +539,9 @@ github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBW github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.3.0 h1:31Re/cPqFHpsRHgyVwjWADPoF0otB1WrjTy8ZFYwEZU= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= +github.com/ipfs/go-log/v2 v2.5.0 h1:+MhAooFd9XZNvR0i9FriKW6HB0ql7HNXUuflWtc0dd4= +github.com/ipfs/go-log/v2 v2.5.0/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= @@ -1033,8 +1034,9 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1426,6 +1428,7 @@ go.uber.org/fx v1.16.0 h1:N8i80+X1DCX+qMRiKzM+jPPZiIiyK/bVCysga3+B+1w= go.uber.org/fx v1.16.0/go.mod h1:OMoT5BnXcOaiexlpjtpE4vcAmzyDKyRs9TRYXCzamx8= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1442,6 +1445,7 @@ go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= diff --git a/p2p/p2p.go b/p2p/p2p.go index 078ba51c477..35004876bee 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -1,7 +1,7 @@ package p2p import ( - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" p2phost "github.com/libp2p/go-libp2p-core/host" peer "github.com/libp2p/go-libp2p-core/peer" pstore "github.com/libp2p/go-libp2p-core/peerstore" diff --git a/peering/peering.go b/peering/peering.go index dbf955cde21..eca0c0aa6d8 100644 --- a/peering/peering.go +++ b/peering/peering.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/ipfs/go-log" + "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" diff --git a/plugin/loader/loader.go b/plugin/loader/loader.go index 167e1b3090b..6297188b002 100644 --- a/plugin/loader/loader.go +++ b/plugin/loader/loader.go @@ -17,7 +17,7 @@ import ( plugin "github.com/ipfs/go-ipfs/plugin" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" opentracing "github.com/opentracing/opentracing-go" ) diff --git a/plugin/plugins/peerlog/peerlog.go b/plugin/plugins/peerlog/peerlog.go index b73722c2c1b..aab7a0efab2 100644 --- a/plugin/plugins/peerlog/peerlog.go +++ b/plugin/plugins/peerlog/peerlog.go @@ -7,7 +7,7 @@ import ( core "github.com/ipfs/go-ipfs/core" plugin "github.com/ipfs/go-ipfs/plugin" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" event "github.com/libp2p/go-libp2p-core/event" network "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 2aa4a5e46c8..cb642a292ff 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -24,7 +24,7 @@ import ( serialize "github.com/ipfs/go-ipfs-config/serialize" util "github.com/ipfs/go-ipfs-util" "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" homedir "github.com/mitchellh/go-homedir" ma "github.com/multiformats/go-multiaddr" ) diff --git a/tar/format.go b/tar/format.go index 2bbf7298fd1..5c118071e9b 100644 --- a/tar/format.go +++ b/tar/format.go @@ -16,7 +16,7 @@ import ( chunker "github.com/ipfs/go-ipfs-chunker" ipld "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ) var log = logging.Logger("tarfmt") diff --git a/test/dependencies/pollEndpoint/main.go b/test/dependencies/pollEndpoint/main.go index 7eadcd3f702..10d3334dff0 100644 --- a/test/dependencies/pollEndpoint/main.go +++ b/test/dependencies/pollEndpoint/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr-net" ) diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index eebc1f63f76..24d45e75e4b 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -17,7 +17,7 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi" mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/thirdparty/unit" - logging "github.com/ipfs/go-log" + logging "github.com/ipfs/go-log/v2" random "github.com/jbenet/go-random" peer "github.com/libp2p/go-libp2p-core/peer" testutil "github.com/libp2p/go-libp2p-testing/net"