Log source of event.

This commit is contained in:
Johannes Mockenhaupt 2017-10-14 16:54:21 +02:00
parent a6ae3ddd2d
commit 9a1d7fd512
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -29,6 +29,14 @@ class LoggingBus extends Bus {
} }
log.debug("Event posted: " + event); log.debug("Event posted: " + event);
try {
StackTraceElement caller = new Throwable().getStackTrace()[1];
String className = caller.getClassName();
className = className.substring(className.lastIndexOf(".") + 1);
log.debug(" source: " + className + "." + caller.getMethodName() + ":" + caller.getLineNumber());
} catch (RuntimeException e) {
log.debug(" source: <unknown>");
}
delegate.post(event); delegate.post(event);
} }
} }