Skip to content

Commit

Permalink
- minor logging fixes
Browse files Browse the repository at this point in the history
- removed TODOs
  • Loading branch information
iulianpascalau committed Jun 30, 2023
1 parent d25ba39 commit 8189d3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 0 additions & 2 deletions libp2p/netMessenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,6 @@ func constructNodeWithPortRetry(
}

func setupExternalP2PLoggers() {
// TODO refactor the external logging by using an environment variable
// for now, we will leave the logs to PANIC as to not record possible ERROR messages during the closing of the host
_ = logging.SetLogLevel("*", "PANIC")

for _, external := range externalPackages {
Expand Down
10 changes: 3 additions & 7 deletions libp2p/peersOnChannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ func (poc *peersOnChannel) refreshPeersOnAllKnownTopics(ctx context.Context) {
case <-time.After(poc.refreshInterval):
}

//TODO remove this
log.Debug("peersOnChannel.refreshPeersOnAllKnownTopics - check")
log.Trace("peersOnChannel.refreshPeersOnAllKnownTopics - check")

listTopicsToBeRefreshed := make([]string, 0)

Expand All @@ -118,8 +117,7 @@ func (poc *peersOnChannel) refreshPeersOnAllKnownTopics(ctx context.Context) {
}
poc.mutPeers.RUnlock()

//TODO remove this
log.Debug("peersOnChannel.refreshPeersOnAllKnownTopics", "listTopicsToBeRefreshed", strings.Join(listTopicsToBeRefreshed, ", "))
log.Trace("peersOnChannel.refreshPeersOnAllKnownTopics", "listTopicsToBeRefreshed", strings.Join(listTopicsToBeRefreshed, ", "))

for _, topic := range listTopicsToBeRefreshed {
_ = poc.refreshPeersOnTopic(topic)
Expand All @@ -131,7 +129,6 @@ func (poc *peersOnChannel) refreshPeersOnAllKnownTopics(ctx context.Context) {
func (poc *peersOnChannel) refreshPeersOnTopic(topic string) []core.PeerID {
list := poc.fetchPeersHandler(topic)
connectedPeers := make([]core.PeerID, len(list))
// TODO remove peers
peers := make([]string, 0, len(list))
for i, pid := range list {
peerID := core.PeerID(pid)
Expand All @@ -142,8 +139,7 @@ func (poc *peersOnChannel) refreshPeersOnTopic(topic string) []core.PeerID {

poc.updateConnectedPeersOnTopic(topic, connectedPeers)

// TODO remove this
log.Debug("refreshed peers on topic", "topic", topic, "connected peers", strings.Join(peers, ", "))
log.Trace("refreshed peers on topic", "topic", topic, "connected peers", strings.Join(peers, ", "))

return connectedPeers
}
Expand Down

0 comments on commit 8189d3c

Please sign in to comment.