SSU1 peer test log level reduction

SSU2 peer test state add alice IP/port back to logging, needed for debugging
This commit is contained in:
zzz
2022-12-23 14:29:19 -05:00
parent 3dd242c1c7
commit a6f7f9ec12
2 changed files with 19 additions and 21 deletions

View File

@@ -1888,8 +1888,8 @@ class PeerTestManager {
// we send two packets below, but increment just once
if (state.incrementPacketsRelayed() > MAX_RELAYED_PER_TEST_CHARLIE) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too many, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too many, not retransmitting: " + state);
return;
}
@@ -1992,8 +1992,8 @@ class PeerTestManager {
state = new PeerTestState(BOB, null, isIPv6, nonce, now);
} else {
if (state.getReceiveAliceTime() > now - (RESEND_TIMEOUT / 2)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too soon, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too soon, not retransmitting: " + state);
return;
}
}
@@ -2005,8 +2005,8 @@ class PeerTestManager {
state.setReceiveAliceTime(now);
if (state.incrementPacketsRelayed() > MAX_RELAYED_PER_TEST_BOB) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too many, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too many, not retransmitting: " + state);
return;
}
@@ -2053,14 +2053,14 @@ class PeerTestManager {
long now = _context.clock().now();
if (state.getReceiveCharlieTime() > now - (RESEND_TIMEOUT / 2)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too soon, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too soon, not retransmitting: " + state);
return;
}
if (state.incrementPacketsRelayed() > MAX_RELAYED_PER_TEST_BOB) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too many, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too many, not retransmitting: " + state);
return;
}
state.setReceiveCharlieTime(now);
@@ -2091,14 +2091,14 @@ class PeerTestManager {
long nonce, PeerTestState state) {
long now = _context.clock().now();
if (state.getReceiveAliceTime() > now - (RESEND_TIMEOUT / 2)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too soon, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too soon, not retransmitting: " + state);
return;
}
if (state.incrementPacketsRelayed() > MAX_RELAYED_PER_TEST_CHARLIE) {
if (_log.shouldLog(Log.WARN))
_log.warn("Too many, not retransmitting: " + state);
if (_log.shouldDebug())
_log.debug("Too many, not retransmitting: " + state);
return;
}
state.setReceiveAliceTime(now);

View File

@@ -262,13 +262,11 @@ class PeerTestState {
.append(" as ").append(_ourRole.toString());
if (_aliceIP != null) {
buf.append("; Alice: ");
if (_ourRole == Role.ALICE) {
buf.append("me");
} else {
buf.append(_aliceIP).append(':').append(_alicePort);
if (_aliceHash != null)
buf.append(' ').append(_aliceHash.toBase64().substring(0, 6));
}
if (_ourRole == Role.ALICE)
buf.append("me ");
buf.append(_aliceIP).append(':').append(_alicePort);
if (_aliceHash != null)
buf.append(' ').append(_aliceHash.toBase64().substring(0, 6));
}
if (_aliceIPFromCharlie != null)
buf.append(" (fromCharlie ").append(_aliceIPFromCharlie).append(':').append(_alicePortFromCharlie).append(')');