From fbce4b7f98c8c1c9814e72fb77a4b9aacbd2df58 Mon Sep 17 00:00:00 2001 From: rene <41963722+renaynay@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:38:08 +0200 Subject: [PATCH] chore(share/p2p/discovery): Change success case logging for advertisement 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. --- nodebuilder/p2p/misc.go | 2 +- share/eds/cache/noop.go | 3 +-- share/p2p/discovery/discovery.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nodebuilder/p2p/misc.go b/nodebuilder/p2p/misc.go index 0d842e0601..df02e0e623 100644 --- a/nodebuilder/p2p/misc.go +++ b/nodebuilder/p2p/misc.go @@ -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" diff --git a/share/eds/cache/noop.go b/share/eds/cache/noop.go index 95a199c345..5d7444054e 100644 --- a/share/eds/cache/noop.go +++ b/share/eds/cache/noop.go @@ -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 { diff --git a/share/p2p/discovery/discovery.go b/share/p2p/discovery/discovery.go index 35cf0afc82..fe99815d94 100644 --- a/share/p2p/discovery/discovery.go +++ b/share/p2p/discovery/discovery.go @@ -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 { @@ -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 }