Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: do not rely on deprecated logger
Browse files Browse the repository at this point in the history
hacdias committed Jun 7, 2023

Unverified

This user has not yet uploaded their public signing key.
1 parent 0927be4 commit 37dc7e9
Showing 29 changed files with 37 additions and 48 deletions.
2 changes: 1 addition & 1 deletion bitswap/bitswap.go
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import (
exchange "github.com/ipfs/boxo/exchange"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/peer"

"go.uber.org/multierr"
2 changes: 1 addition & 1 deletion bitswap/client/client.go
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ import (
exchange "github.com/ipfs/boxo/exchange"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"
process "github.com/jbenet/goprocess"
procctx "github.com/jbenet/goprocess/context"
2 changes: 1 addition & 1 deletion bitswap/client/internal/getter/getter.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (

"github.com/ipfs/boxo/bitswap/client/internal"
notifications "github.com/ipfs/boxo/bitswap/client/internal/notifications"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"

blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
2 changes: 1 addition & 1 deletion bitswap/client/internal/messagequeue/messagequeue.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import (
pb "github.com/ipfs/boxo/bitswap/message/pb"
bsnet "github.com/ipfs/boxo/bitswap/network"
cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
peer "github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
"go.uber.org/zap"
2 changes: 1 addition & 1 deletion bitswap/client/internal/peermanager/peermanager.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"context"
"sync"

logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"

cid "github.com/ipfs/go-cid"
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"time"

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
peer "github.com/libp2p/go-libp2p/core/peer"
)

2 changes: 1 addition & 1 deletion bitswap/client/internal/session/session.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
delay "github.com/ipfs/go-ipfs-delay"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
peer "github.com/libp2p/go-libp2p/core/peer"
"go.uber.org/zap"
)
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"fmt"
"sync"

logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"

peer "github.com/libp2p/go-libp2p/core/peer"
)
2 changes: 1 addition & 1 deletion bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import (
"github.com/ipfs/boxo/bitswap/network/internal"

cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
2 changes: 1 addition & 1 deletion bitswap/server/internal/decision/engine.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import (
bstore "github.com/ipfs/boxo/blockstore"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"
"github.com/ipfs/go-peertaskqueue"
"github.com/ipfs/go-peertaskqueue/peertask"
2 changes: 1 addition & 1 deletion bitswap/server/server.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import (
blockstore "github.com/ipfs/boxo/blockstore"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"
process "github.com/jbenet/goprocess"
procctx "github.com/jbenet/goprocess/context"
2 changes: 1 addition & 1 deletion blockstore/blockstore.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import (
dsns "github.com/ipfs/go-datastore/namespace"
dsq "github.com/ipfs/go-datastore/query"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
uatomic "go.uber.org/atomic"
)

2 changes: 1 addition & 1 deletion chunker/splitting.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ package chunk
import (
"io"

logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
pool "github.com/libp2p/go-buffer-pool"
)

2 changes: 1 addition & 1 deletion filestore/filestore.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import (
cid "github.com/ipfs/go-cid"
dsq "github.com/ipfs/go-datastore/query"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
)

var logger = logging.Logger("filestore")
2 changes: 1 addition & 1 deletion gateway/handler.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ import (
ipath "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/gateway/assets"
cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multibase"
prometheus "github.com/prometheus/client_golang/prometheus"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ require (
github.com/ipfs/go-ipld-cbor v0.0.6
github.com/ipfs/go-ipld-format v0.4.0
github.com/ipfs/go-ipld-legacy v0.1.1
github.com/ipfs/go-log v1.0.5
github.com/ipfs/go-log/v2 v2.5.1
github.com/ipfs/go-metrics-interface v0.0.1
github.com/ipfs/go-peertaskqueue v0.8.1
@@ -115,6 +114,7 @@ require (
github.com/ipfs/go-ipfs-pq v0.0.3 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipns v0.3.0 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-unixfs v0.4.5 // indirect
github.com/ipld/go-car/v2 v2.9.1-0.20230325062757-fff0e4397a3d // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
2 changes: 1 addition & 1 deletion ipld/unixfs/io/directory.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
format "github.com/ipfs/boxo/ipld/unixfs"
"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"
)

var log = logging.Logger("unixfs")
2 changes: 1 addition & 1 deletion keystore/keystore.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (

"encoding/base32"

logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
ci "github.com/libp2p/go-libp2p/core/crypto"
)

2 changes: 1 addition & 1 deletion mfs/root.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
ft "github.com/ipfs/boxo/ipld/unixfs"

ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
)

// TODO: Remove if not used.
2 changes: 1 addition & 1 deletion namesys/republisher/repub.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import (
"github.com/ipfs/boxo/ipns"
pb "github.com/ipfs/boxo/ipns/pb"
ds "github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/jbenet/goprocess"
gpctx "github.com/jbenet/goprocess/context"
ic "github.com/libp2p/go-libp2p/core/crypto"
2 changes: 1 addition & 1 deletion namesys/routing.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
pb "github.com/ipfs/boxo/ipns/pb"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
28 changes: 8 additions & 20 deletions path/resolver/resolver.go
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import (
"github.com/ipfs/boxo/path/internal"
cid "github.com/ipfs/go-cid"
format "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/ipld/go-ipld-prime"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
basicnode "github.com/ipld/go-ipld-prime/node/basic"
@@ -190,34 +190,26 @@ func ResolveSingle(ctx context.Context, ds format.NodeGetter, nd format.Node, na
//
// Note: if/when the context is cancelled or expires then if a multi-block ADL node is returned then it may not be
// possible to load certain values.
func (r *basicResolver) ResolvePathComponents(ctx context.Context, fpath path.Path) ([]ipld.Node, error) {
func (r *basicResolver) ResolvePathComponents(ctx context.Context, fpath path.Path) (nodes []ipld.Node, err error) {
ctx, span := internal.StartSpan(ctx, "basicResolver.ResolvePathComponents", trace.WithAttributes(attribute.Stringer("Path", fpath)))
defer span.End()

//lint:ignore SA1019 TODO: replace EventBegin
evt := log.EventBegin(ctx, "resolvePathComponents", logging.LoggableMap{"fpath": fpath})
defer evt.Done()
defer log.Debugw("resolvePathComponents", "fpath", fpath, "error", err)

// validate path
if err := fpath.IsValid(); err != nil {
evt.Append(logging.LoggableMap{"error": err.Error()})
return nil, err
}

c, p, err := path.SplitAbsPath(fpath)
if err != nil {
evt.Append(logging.LoggableMap{"error": err.Error()})
return nil, err
}

// create a selector to traverse and match all path segments
pathSelector := pathAllSelector(p)

nodes, _, _, err := r.resolveNodes(ctx, c, pathSelector)
if err != nil {
evt.Append(logging.LoggableMap{"error": err.Error()})
}

nodes, _, _, err = r.resolveNodes(ctx, c, pathSelector)
return nodes, err
}

@@ -231,27 +223,23 @@ func (r *basicResolver) ResolvePathComponents(ctx context.Context, fpath path.Pa
//
// Note: if/when the context is cancelled or expires then if a multi-block ADL node is returned then it may not be
// possible to load certain values.
func (r *basicResolver) ResolveLinks(ctx context.Context, ndd ipld.Node, names []string) ([]ipld.Node, error) {
func (r *basicResolver) ResolveLinks(ctx context.Context, ndd ipld.Node, names []string) (nodes []ipld.Node, err error) {
ctx, span := internal.StartSpan(ctx, "basicResolver.ResolveLinks")
defer span.End()

//lint:ignore SA1019 TODO: replace EventBegin
evt := log.EventBegin(ctx, "resolveLinks", logging.LoggableMap{"names": names})
defer evt.Done()

defer log.Debugw("resolvePathComponents", "names", names, "error", err)
// create a selector to traverse and match all path segments
pathSelector := pathAllSelector(names)

session := r.FetcherFactory.NewSession(ctx)

// traverse selector
nodes := []ipld.Node{ndd}
err := session.NodeMatching(ctx, ndd, pathSelector, func(res fetcher.FetchResult) error {
nodes = []ipld.Node{ndd}
err = session.NodeMatching(ctx, ndd, pathSelector, func(res fetcher.FetchResult) error {
nodes = append(nodes, res.Node)
return nil
})
if err != nil {
evt.Append(logging.LoggableMap{"error": err.Error()})
return nil, err
}

2 changes: 1 addition & 1 deletion pinning/pinner/dspinner/pin.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (
ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/polydawn/refmt/cbor"
"github.com/polydawn/refmt/obj/atlas"

2 changes: 1 addition & 1 deletion pinning/pinner/dspinner/pin_test.go
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import (
"github.com/ipfs/go-datastore/query"
dssync "github.com/ipfs/go-datastore/sync"
ipld "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"

blockstore "github.com/ipfs/boxo/blockstore"
offline "github.com/ipfs/boxo/exchange/offline"
2 changes: 1 addition & 1 deletion provider/batched/system.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (
"github.com/ipfs/boxo/verifcid"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/multiformats/go-multihash"
)

3 changes: 2 additions & 1 deletion provider/queue/queue.go
Original file line number Diff line number Diff line change
@@ -3,11 +3,12 @@ package queue
import (
"context"
"fmt"

cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
namespace "github.com/ipfs/go-datastore/namespace"
query "github.com/ipfs/go-datastore/query"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
)

var log = logging.Logger("provider.queue")
2 changes: 1 addition & 1 deletion provider/simple/provider.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (

q "github.com/ipfs/boxo/provider/queue"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/routing"
)

2 changes: 1 addition & 1 deletion provider/simple/reprovide.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
"github.com/cenkalti/backoff"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-cidutil"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
"github.com/libp2p/go-libp2p/core/routing"

2 changes: 1 addition & 1 deletion routing/mock/centralized_client.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"time"

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
tnet "github.com/libp2p/go-libp2p-testing/net"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"

0 comments on commit 37dc7e9

Please sign in to comment.