Router: I2NP debug log improvements

This commit is contained in:
zzz
2020-05-01 11:51:28 +00:00
parent d7095b69b9
commit 90d9843acc
2 changed files with 15 additions and 13 deletions

View File

@ -99,8 +99,7 @@ public class DataMessage extends FastI2NPMessageImpl {
@Override @Override
public String toString() { public String toString() {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
buf.append("[DataMessage: "); buf.append("[DataMessage: data ");
buf.append("\n\tData: ");
if (_data != null) { if (_data != null) {
buf.append(_data.length).append(" bytes"); buf.append(_data.length).append(" bytes");
if (_data.length <= 64) if (_data.length <= 64)
@ -108,7 +107,7 @@ public class DataMessage extends FastI2NPMessageImpl {
} else { } else {
buf.append("null"); buf.append("null");
} }
buf.append("]"); buf.append(']');
return buf.toString(); return buf.toString();
} }
} }

View File

@ -445,25 +445,28 @@ public class DeliveryInstructions extends DataStructureImpl {
buf.append("\n\tDelivery mode: "); buf.append("\n\tDelivery mode: ");
switch (getDeliveryMode()) { switch (getDeliveryMode()) {
case DELIVERY_MODE_LOCAL: case DELIVERY_MODE_LOCAL:
buf.append("local"); buf.append("Local");
break; break;
case DELIVERY_MODE_DESTINATION: case DELIVERY_MODE_DESTINATION:
buf.append("destination"); buf.append("Destination");
break; break;
case DELIVERY_MODE_ROUTER: case DELIVERY_MODE_ROUTER:
buf.append("router"); buf.append("Router");
break; break;
case DELIVERY_MODE_TUNNEL: case DELIVERY_MODE_TUNNEL:
buf.append("tunnel"); buf.append("Tunnel");
break; break;
} }
buf.append("\n\tDelay requested: ").append(getDelayRequested()); if (_delayRequested)
buf.append("\n\tDelay seconds: ").append(getDelaySeconds()); buf.append("\n\tDelay seconds: ").append(_delaySeconds);
buf.append("\n\tDestination: ").append(getDestination()); if (_destinationHash != null)
buf.append("\n\tDestination: ").append(_destinationHash.toBase32());
//buf.append("\n\tEncrypted: ").append(getEncrypted()); //buf.append("\n\tEncrypted: ").append(getEncrypted());
buf.append("\n\tEncryption key: ").append(getEncryptionKey()); //buf.append("\n\tEncryption key: ").append(getEncryptionKey());
buf.append("\n\tRouter: ").append(getRouter()); if (_routerHash != null)
buf.append("\n\tTunnelId: ").append(getTunnelId()); buf.append("\n\tRouter: ").append(_routerHash.toBase64());
if (_tunnelId != null)
buf.append("\n\tTunnelId: ").append(_tunnelId);
return buf.toString(); return buf.toString();
} }