Skip to content

Commit

Permalink
chore(share/p2p/discovery): Change success case logging for advertise…
Browse files Browse the repository at this point in the history
…ment to INFO level (#3492)

These logs would happen infrequently anyway (hourly) and we only logged
error case so would be nice to see the success case without having to
enable debug logs.

Also some random linter failure fixes on my end.
  • Loading branch information
renaynay committed Jun 11, 2024
1 parent edef750 commit fbce4b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nodebuilder/p2p/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/ipfs/go-datastore"
connmgri "github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds" //nolint:staticcheck
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds" //nolint:staticcheck //nolint:nolintlint
"github.com/libp2p/go-libp2p/p2p/net/conngater"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"

Expand Down
3 changes: 1 addition & 2 deletions share/eds/cache/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ var _ Accessor = (*NoopAccessor)(nil)
type NoopAccessor struct{}

func (n NoopAccessor) Blockstore() (dagstore.ReadBlockstore, error) {
//nolint:nilnil
return nil, nil
return nil, nil //nolint:nilnil
}

func (n NoopAccessor) Reader() io.Reader {
Expand Down
4 changes: 2 additions & 2 deletions share/p2p/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (d *Discovery) Advertise(ctx context.Context) {
timer := time.NewTimer(d.params.AdvertiseInterval)
defer timer.Stop()
for {
log.Debugf("advertising to topic %s", d.tag)
log.Infof("advertising to topic %s", d.tag)
_, err := d.disc.Advertise(ctx, d.tag)
d.metrics.observeAdvertise(ctx, err)
if err != nil {
Expand All @@ -195,7 +195,7 @@ func (d *Discovery) Advertise(ctx context.Context) {
}
}

log.Debugf("successfully advertised to topic %s", d.tag)
log.Infof("successfully advertised to topic %s", d.tag)
if !timer.Stop() {
<-timer.C
}
Expand Down

0 comments on commit fbce4b7

Please sign in to comment.