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

feat: add log printing when peer added and removed table #134

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

elecbug
Copy link
Contributor

@elecbug elecbug commented Aug 27, 2024

As of now, I don't think there is a major log in Kademlia that certainly can determine that a peer has been added.

The login 'msg': 'peer found' output, which is called prior to the commit, is only an possibility to add for the peer, and the fact that 'rt.PeerAdd()', which is actually called when a peer is added, is an empty function makes it difficult to measure the performance of Kademlia.

		PeerRemoved: func(p peer.ID) {
			log.Debugw("peer removed", "peer", p)
		},
		PeerAdded: func(p peer.ID) {
			log.Debugw("peer added", "peer", p)
		},

Thus, a simple log-add syntax was added.

Copy link
Contributor

@guillaumemichel guillaumemichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks @elecbug!

@guillaumemichel guillaumemichel merged commit 3b044bb into libp2p:master Aug 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants