Add a method getAndClearLogEntries(type), call it from the handled, deal with nonexistent types in that method not the handler. The handler should have no business logic preferably.