Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(bitswap): unify logger names #637

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The following emojis are used to highlight certain changes:
### Changed

- `bitswap/server` minor memory use and performance improvements
- `bitswap` unify logger names to use uniform format bitswap/path/pkgname

### Removed

Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"go.opentelemetry.io/otel/trace"
)

var log = logging.Logger("bitswap-client")
var log = logging.Logger("bitswap/client")

// Option defines the functional option type that can be used to configure
// bitswap instances
Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/internal/getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ipld "github.com/ipfs/go-ipld-format"
)

var log = logging.Logger("bitswap")
var log = logging.Logger("bitswap/client/getter")

// GetBlocksFunc is any function that can take an array of CIDs and return a
// channel of incoming blocks.
Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/internal/messagequeue/messagequeue.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
log = logging.Logger("bitswap")
log = logging.Logger("bitswap/client/msgq")
sflog = log.Desugar()
)

Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/internal/peermanager/peermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
peer "github.com/libp2p/go-libp2p/core/peer"
)

var log = logging.Logger("bs:peermgr")
var log = logging.Logger("bitswap/client/peermgr")

// PeerQueue provides a queue of messages to be sent for a single peer.
type PeerQueue interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"go.opentelemetry.io/otel/trace"
)

var log = logging.Logger("bitswap")
var log = logging.Logger("bitswap/client/provqrymgr")

const (
maxProviders = 10
Expand Down
2 changes: 1 addition & 1 deletion bitswap/client/internal/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

var (
log = logging.Logger("bs:sess")
log = logging.Logger("bitswap/session")
sflog = log.Desugar()
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
peer "github.com/libp2p/go-libp2p/core/peer"
)

var log = logging.Logger("bs:sprmgr")
var log = logging.Logger("bitswap/client/sesspeermgr")

const (
// Connection Manager tag value for session peers. Indicates to connection
Expand Down
2 changes: 1 addition & 1 deletion bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/multiformats/go-multistream"
)

var log = logging.Logger("bitswap_network")
var log = logging.Logger("bitswap/network")

var connectTimeout = time.Second * 5

Expand Down
2 changes: 1 addition & 1 deletion bitswap/server/internal/decision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import (
// whatever it sees fit to produce desired outcomes (get wanted keys
// quickly, maintain good relationships with peers, etc).

var log = logging.Logger("engine")
var log = logging.Logger("bitswap/server/decision")

const (
// outboxChanBuffer must be 0 to prevent stale messages from being sent
Expand Down
2 changes: 1 addition & 1 deletion bitswap/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
var provideKeysBufferSize = 2048

var (
log = logging.Logger("bitswap-server")
log = logging.Logger("bitswap/server")
sflog = log.Desugar()
)

Expand Down