Log unhandled dead events
This commit is contained in:
@ -18,8 +18,13 @@ public final class DeadEvent {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("DeadEvent[eventBus=%s, event=%s]", eventBus, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the event bus that originated this event
|
||||
* @return the event bus that dispatched this event
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public EventBus getEventBus() { return eventBus; }
|
||||
|
@ -84,7 +84,13 @@ public final class EventBus {
|
||||
handlers.next().execute(event);
|
||||
}
|
||||
} else if (!(event instanceof DeadEvent)) {
|
||||
|
||||
// Dispatch dead event
|
||||
dispatch(new DeadEvent(this, event));
|
||||
} else {
|
||||
|
||||
// Warn about the dead event not being handled
|
||||
logger.log(Level.WARNING, "{0} not handled", event);
|
||||
}
|
||||
|
||||
// Reset dispatch state
|
||||
|
Reference in New Issue
Block a user