-
Notifications
You must be signed in to change notification settings - Fork 969
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
Overlay logging improvement #2276
Overlay logging improvement #2276
Conversation
src/overlay/OverlayManagerImpl.cpp
Outdated
@@ -201,10 +209,33 @@ OverlayManagerImpl::PeersList::acceptAuthenticatedPeer(Peer::pointer peer) | |||
|
|||
CLOG(INFO, "Overlay") << "Non preferred " << mDirectionString | |||
<< " authenticated peer " << peer->toString() | |||
<< " rejected because all available slots are taken."; | |||
<< " rejected because all available slots are taken." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these lines are out of order. Adding a function for this also would have avoided this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing: I do want this "@..." thing at the end of the line
src/overlay/OverlayManagerImpl.cpp
Outdated
@@ -113,7 +114,8 @@ OverlayManagerImpl::PeersList::removePeer(Peer* peer) | |||
if (pendingIt != std::end(mPending)) | |||
{ | |||
CLOG(DEBUG, "Overlay") << "Dropping pending " << mDirectionString | |||
<< " peer: " << peer->toString(); | |||
<< " peer: " << peer->toString() << " @" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend for no space between "@" and the port? This is the case in every log line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes it simpler to grep
src/overlay/OverlayManagerImpl.cpp
Outdated
@@ -142,7 +146,8 @@ OverlayManagerImpl::PeersList::moveToAuthenticated(Peer::pointer peer) | |||
{ | |||
CLOG(WARNING, "Overlay") | |||
<< "Trying to move non-pending " << mDirectionString << " peer " | |||
<< peer->toString() << " to authenticated list"; | |||
<< peer->toString() << " to authenticated list" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant to have "to authenticated list" after the port. In order to avoid issues like this, I think it would be better to use a function like std::string Peer::toStringWithPort() const
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, the port is not related to peer
but to the application, and I'd rather keep this at the end of the line to limit the confusion
std::stringstream pending, authenticated; | ||
for (auto p : mPending) | ||
{ | ||
pending << p->toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to add the port here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no: port is unrelated to p
and there is already context from the INFO
entry above
da59330
to
45cd965
Compare
r+ 45cd965 |
@latobarita: retry |
@latobarita: retry |
45cd965
to
04dcaf5
Compare
r+ 04dcaf5530e5a0cb5a3704b24f14bc9520cfcc61 |
04dcaf5
to
6556353
Compare
Issue was that I forgot to update one of the tests when I removed some of the constraints on |
r+ 6556353 |
Overlay logging improvement Reviewed-by: MonsieurNicolas
Description
This PR:
Hello