From f2f09a359d7a78edea6a1e6bb55e8149adf82bda Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 22 Jul 2018 22:58:56 +0100 Subject: [PATCH] add logging to event bus --- core/src/main/groovy/com/muwire/core/EventBus.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/groovy/com/muwire/core/EventBus.groovy b/core/src/main/groovy/com/muwire/core/EventBus.groovy index a02543c9..5b43ca1f 100644 --- a/core/src/main/groovy/com/muwire/core/EventBus.groovy +++ b/core/src/main/groovy/com/muwire/core/EventBus.groovy @@ -4,11 +4,14 @@ import java.util.concurrent.CopyOnWriteArrayList import com.muwire.core.files.FileSharedEvent +import groovy.util.logging.Log +@Log class EventBus { private Map handlers = new HashMap() void publish(Event e) { + log.fine "publishing event of type ${e.getClass().getSimpleName()}" def currentHandlers final def clazz = e.getClass() synchronized(handlers) { @@ -20,6 +23,7 @@ class EventBus { } synchronized void register(Class eventType, def handler) { + log.info "Registering $handler for type $eventType" def currentHandlers = handlers.get(eventType) if (currentHandlers == null) { currentHandlers = new CopyOnWriteArrayList()