diff --git a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java index 18f51624..652ddb86 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java +++ b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java @@ -19,9 +19,8 @@ package de.staropensource.sosengine.base; -import de.staropensource.sosengine.base.implementable.ShortcodeParser; import de.staropensource.sosengine.base.implementable.Configuration; -import de.staropensource.sosengine.base.implementable.helper.EventHelper; +import de.staropensource.sosengine.base.implementable.ShortcodeParser; import de.staropensource.sosengine.base.logging.CrashHandler; import de.staropensource.sosengine.base.logging.Logger; import de.staropensource.sosengine.base.logging.LoggingThread; @@ -95,7 +94,6 @@ public final class EngineConfiguration extends Configuration { /** * If enabled, all called events will be logged. * - * @see EventHelper#logCall(Class, Object...) * @since v1-alpha0 * -- GETTER -- * Gets the value for {@link #debugEvents}. diff --git a/base/src/main/java/de/staropensource/sosengine/base/implementable/helper/EventHelper.java b/base/src/main/java/de/staropensource/sosengine/base/implementable/helper/EventHelper.java index 69bac5ac..019f2f99 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/implementable/helper/EventHelper.java +++ b/base/src/main/java/de/staropensource/sosengine/base/implementable/helper/EventHelper.java @@ -76,22 +76,6 @@ public final class EventHelper { */ public EventHelper() {} - /** - * Logs an event call. - * - * @param event event class - * @param arguments arguments passed to event listeners - * @since v1-alpha0 - */ - public static void logCall(@NotNull Class event, @NotNull Object ... arguments) { - // Print event call if event debugging is enabled - if (EngineConfiguration.getInstance().isDebugEvents()) - if (arguments.length == 0) - logger.diag("Event " + event.getName() + " was emitted"); - else - logger.diag("Event " + event.getName() + " was emitted, passing arguments " + ListFormatter.formatArray(arguments)); - } - /** * Returns all {@link EventListener}s listening on some event. * The classpath will be scanned for listeners, unless cached results exist and {@code !forceScanning}. @@ -149,8 +133,11 @@ public final class EventHelper { * @since v1-alpha0 */ public static void invokeAnnotatedMethods(@NotNull Class event, Object... arguments) { - if (event != LogEvent.class) - logCall(event); + if (event != LogEvent.class && EngineConfiguration.getInstance().isDebugEvents()) + if (arguments.length == 0) + logger.diag("Event " + event.getName() + " was emitted"); + else + logger.diag("Event " + event.getName() + " was emitted, passing arguments " + ListFormatter.formatArray(arguments)); Runnable eventCode = () -> { for (ReflectionMethod method : getAnnotatedMethods(event)) {