toString() for logging

This commit is contained in:
zzz
2010-04-07 23:21:45 +00:00
parent ad76bc378c
commit f5f02236df
3 changed files with 28 additions and 1 deletions

View File

@@ -736,4 +736,16 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
SimpleScheduler.getInstance().addEvent(new SessionIdleTimer(_context, this, reduce, close), SessionIdleTimer.MINIMUM_TIME);
}
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(32);
buf.append("Session: ");
if (_myDestination != null)
buf.append(_myDestination.calculateHash().toBase64().substring(0, 4));
else
buf.append("[null dest]");
buf.append(getPrefix());
return buf.toString();
}
}