From 91b2ab7a22af96f049b5ac7e1f634b1b05ebcbce Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 1 Dec 2024 16:40:06 +0100 Subject: [PATCH] Add check if logging adapter has changed --- .../java/de/staropensource/engine/ansi/AnsiSubsystem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansi/src/main/java/de/staropensource/engine/ansi/AnsiSubsystem.java b/ansi/src/main/java/de/staropensource/engine/ansi/AnsiSubsystem.java index 8ad05c310..a70180014 100644 --- a/ansi/src/main/java/de/staropensource/engine/ansi/AnsiSubsystem.java +++ b/ansi/src/main/java/de/staropensource/engine/ansi/AnsiSubsystem.java @@ -21,6 +21,7 @@ package de.staropensource.engine.ansi; import de.staropensource.engine.base.annotation.EngineSubsystem; import de.staropensource.engine.base.implementable.SubsystemClass; +import de.staropensource.engine.base.implementation.logging.PlainLoggingAdapter; import de.staropensource.engine.base.utility.information.EngineInformation; import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem; import de.staropensource.engine.base.logging.Logger; @@ -71,7 +72,8 @@ public final class AnsiSubsystem extends SubsystemClass { /** {@inheritDoc} */ @Override public void initializeSubsystem() { - Logger.setLoggingAdapter(new AnsiLoggingAdapter()); + if (Logger.getLoggingAdapter().getClass().getName().equals(PlainLoggingAdapter.class.getName())) + Logger.setLoggingAdapter(new AnsiLoggingAdapter()); } /** {@inheritDoc} */