forked from StarOpenSource/Engine
Disallow logCall() invocation on LogEvent
This commit is contained in:
parent
9d3397888d
commit
aaa81e2f87
2 changed files with 5 additions and 2 deletions
|
@ -22,6 +22,7 @@ package de.staropensource.sosengine.base.classes.helpers;
|
||||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
import de.staropensource.sosengine.base.EngineConfiguration;
|
||||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
import de.staropensource.sosengine.base.annotations.EventListener;
|
||||||
import de.staropensource.sosengine.base.classes.Event;
|
import de.staropensource.sosengine.base.classes.Event;
|
||||||
|
import de.staropensource.sosengine.base.events.LogEvent;
|
||||||
import de.staropensource.sosengine.base.exceptions.UnexpectedThrowableException;
|
import de.staropensource.sosengine.base.exceptions.UnexpectedThrowableException;
|
||||||
import de.staropensource.sosengine.base.exceptions.reflection.InstanceMethodFromStaticContextException;
|
import de.staropensource.sosengine.base.exceptions.reflection.InstanceMethodFromStaticContextException;
|
||||||
import de.staropensource.sosengine.base.exceptions.reflection.InvalidMethodSignature;
|
import de.staropensource.sosengine.base.exceptions.reflection.InvalidMethodSignature;
|
||||||
|
@ -144,6 +145,7 @@ public class EventHelper {
|
||||||
public static void invokeAnnotatedMethods(@NotNull Class<? extends Event> event, Object... arguments) {
|
public static void invokeAnnotatedMethods(@NotNull Class<? extends Event> event, Object... arguments) {
|
||||||
Runnable eventCode = () -> {
|
Runnable eventCode = () -> {
|
||||||
LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE));
|
LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE));
|
||||||
|
if (event != LogEvent.class)
|
||||||
logCall(event);
|
logCall(event);
|
||||||
|
|
||||||
for (ReflectionMethod method : getAnnotatedMethods(event)) {
|
for (ReflectionMethod method : getAnnotatedMethods(event)) {
|
||||||
|
|
|
@ -215,7 +215,8 @@ public final class Logger {
|
||||||
base = loggerImplementation.postPlaceholder(level, issuer, base);
|
base = loggerImplementation.postPlaceholder(level, issuer, base);
|
||||||
|
|
||||||
// Call event
|
// Call event
|
||||||
if (!(issuer.getClazz().getName().equals("de.staropensource.sosengine.slf4j_compat.CompatibilityLogger") || issuer.getClazz().equals(EventHelper.class)))
|
if (!(issuer.getClazz().getName().equals("de.staropensource.sosengine.slf4j_compat.CompatibilityLogger")
|
||||||
|
|| issuer.getClazz().equals(EventHelper.class)))
|
||||||
new LogEvent().callEvent(level, issuer, message);
|
new LogEvent().callEvent(level, issuer, message);
|
||||||
|
|
||||||
// Print log message by invoking LoggerImpl#print
|
// Print log message by invoking LoggerImpl#print
|
||||||
|
|
Loading…
Reference in a new issue