toString() methods in some events

pull/4/head
Zlatin Balevsky 2018-07-26 18:40:08 +01:00
parent 351edcb20e
commit 3b616b8947
5 changed files with 21 additions and 1 deletions

View File

@ -12,4 +12,9 @@ class Event {
seqNo = SEQ_NO.getAndIncrement()
timestamp = System.currentTimeMillis()
}
@Override
public String toString() {
"seqNo $seqNo timestamp $timestamp"
}
}

View File

@ -23,7 +23,7 @@ class EventBus {
}
private void publishInternal(Event e) {
log.fine "publishing event of type ${e.getClass().getSimpleName()} seqNo ${e.seqNo} timestamp ${e.timestamp}"
log.fine "publishing event $e"
def currentHandlers
final def clazz = e.getClass()
synchronized(this) {

View File

@ -10,5 +10,10 @@ class ConnectionEvent extends Event {
boolean incoming
Boolean leaf // can be null if uknown
ConnectionAttemptStatus status
@Override
public String toString() {
"ConnectionEvent ${super.toString()} endpoint: $endpoint incoming: $incoming leaf : $leaf status : $status"
}
}

View File

@ -32,4 +32,9 @@ class Endpoint implements Closeable {
try {outputStream.close()} catch (Exception ignore) {}
}
}
@Override
public String toString() {
"destination: ${destination.toBase32()}"
}
}

View File

@ -7,4 +7,9 @@ import net.i2p.data.Destination
class HostDiscoveredEvent extends Event {
Destination destination
@Override
public String toString() {
"HostDiscoveredEvent ${super.toString()} destination:${destination.toBase32()}"
}
}