From 889d1064709020f4349148945632713b6ebfa999 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 1 Sep 2024 16:58:49 +0200 Subject: [PATCH] Rename loggerImplementation in Logger class --- .../sosengine/ansi/AnsiSubsystem.java | 2 +- .../base/implementable/LoggingAdapter.java | 2 +- .../sosengine/base/logging/CrashHandler.java | 12 ++++++------ .../sosengine/base/logging/InitLogger.java | 12 ++++++------ .../sosengine/base/logging/Logger.java | 16 ++++++++-------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ansi/src/main/java/de/staropensource/sosengine/ansi/AnsiSubsystem.java b/ansi/src/main/java/de/staropensource/sosengine/ansi/AnsiSubsystem.java index 74e860f..97c3a87 100644 --- a/ansi/src/main/java/de/staropensource/sosengine/ansi/AnsiSubsystem.java +++ b/ansi/src/main/java/de/staropensource/sosengine/ansi/AnsiSubsystem.java @@ -71,7 +71,7 @@ public final class AnsiSubsystem extends SubsystemClass { /** {@inheritDoc} */ @Override public void initializeSubsystem() { - Logger.setLoggerImplementation(new AnsiLoggingAdapter()); + Logger.setLoggingAdapter(new AnsiLoggingAdapter()); } /** {@inheritDoc} */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/implementable/LoggingAdapter.java b/base/src/main/java/de/staropensource/sosengine/base/implementable/LoggingAdapter.java index ec7d6fb..3053545 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/implementable/LoggingAdapter.java +++ b/base/src/main/java/de/staropensource/sosengine/base/implementable/LoggingAdapter.java @@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable; /** * Interface for implementing custom logger implementations. * - * @see Logger#setLoggerImplementation(LoggingAdapter) + * @see Logger#setLoggingAdapter(LoggingAdapter) * @since v1-alpha0 */ public interface LoggingAdapter { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java b/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java index c09f829..584970b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java @@ -133,8 +133,8 @@ Dear developer: FIX YOUR GODDAMN SHIT! Please check if your code or 3rd party su .replace("%content%", processCrashContent()) .replace("%handled%", throwableHandled ? "!!! This throwable is declared as handled and has been passed down the execution chain !!!" : ""); - // Invoke LoggerImpl#prePlaceholder - String temp = Logger.getLoggerImplementation().prePlaceholder(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); + // Invoke LoggingAdapter#prePlaceholder + String temp = Logger.getLoggingAdapter().prePlaceholder(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); if (temp != null) base = temp; @@ -155,12 +155,12 @@ Dear developer: FIX YOUR GODDAMN SHIT! Please check if your code or 3rd party su // Replace placeholders base = PlaceholderEngine.getInstance().process(base, temporaryPlaceholders); - // Invoke LoggerImpl#postPlaceholder - base = Logger.getLoggerImplementation().postPlaceholder(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); + // Invoke LoggingAdapter#postPlaceholder + base = Logger.getLoggingAdapter().postPlaceholder(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); - // Print log message by invoking LoggerImpl#print + // Print log message by invoking LoggingAdapter#print Logger.flushLogMessages(); - Logger.getLoggerImplementation().print(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); + Logger.getLoggingAdapter().print(LogLevel.CRASH, issuerClass, issuerOrigin, issuerMetadata, message, base); // Emit event if (throwableHandled) diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/InitLogger.java b/base/src/main/java/de/staropensource/sosengine/base/logging/InitLogger.java index 12dece5..25e5f1b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/InitLogger.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/InitLogger.java @@ -60,8 +60,8 @@ public final class InitLogger { if (level.compareTo(EngineConfiguration.getInstance().getLoggerLevel()) < 0) return; - // Invoke LoggerImpl#prePlaceholder - String base = Logger.getLoggerImplementation().prePlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, template); + // Invoke LoggingAdapter#prePlaceholder + String base = Logger.getLoggingAdapter().prePlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, template); if (base == null) base = template; @@ -71,11 +71,11 @@ public final class InitLogger { base = new LogPath(issuerClass).replace(base); base = base.replace("%log_message%", message.replace("\n", "")); - // Invoke LoggerImpl#postPlaceholder - base = Logger.getLoggerImplementation().postPlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, base); + // Invoke LoggingAdapter#postPlaceholder + base = Logger.getLoggingAdapter().postPlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, base); - // Print log message by invoking LoggerImpl#print - Logger.getLoggerImplementation().print(level, issuerClass, issuerOrigin, issuerMetadata, message, base); + // Print log message by invoking LoggingAdapter#print + Logger.getLoggingAdapter().print(level, issuerClass, issuerOrigin, issuerMetadata, message, base); } /** diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java b/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java index fe80a04..15856da 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java @@ -88,13 +88,13 @@ public final class Logger { * -- SETTER -- * Sets the active {@link LoggingAdapter}. * - * @param loggerImplementation new active {@link LoggingAdapter} + * @param loggingAdapter new active {@link LoggingAdapter} * @see LoggingAdapter * @since v1-alpha0 */ @Getter @Setter - private static @NotNull LoggingAdapter loggerImplementation = new PlainLoggingAdapter(); + private static @NotNull LoggingAdapter loggingAdapter = new PlainLoggingAdapter(); /** * Contains all active {@link LogRule}s. @@ -195,8 +195,8 @@ public final class Logger { } } - // Invoke LoggerImpl#prePlaceholder - String format = loggerImplementation.prePlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, EngineConfiguration.getInstance().getLoggerTemplate()); + // Invoke LoggingAdapter#prePlaceholder + String format = loggingAdapter.prePlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, EngineConfiguration.getInstance().getLoggerTemplate()); if (format == null) format = EngineConfiguration.getInstance().getLoggerTemplate(); @@ -262,16 +262,16 @@ public final class Logger { // Replace placeholders using PlaceholderEngine again format = PlaceholderEngine.getInstance().process(format); - // Invoke LoggerImpl#postPlaceholder - format = loggerImplementation.postPlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, format); + // Invoke LoggingAdapter#postPlaceholder + format = loggingAdapter.postPlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, format); // Call event if (!(issuerClass.getName().equals("de.staropensource.sosengine.slf4j_compat.CompatibilityLogger") || issuerClass.equals(EventHelper.class))) new LogEvent().callEvent(level, issuerClass, issuerOrigin, issuerMetadata, message); - // Print log message by invoking LoggerImpl#print - loggerImplementation.print(level, issuerClass, issuerOrigin, issuerMetadata, message, format); + // Print log message by invoking LoggingAdapter#print + loggingAdapter.print(level, issuerClass, issuerOrigin, issuerMetadata, message, format); } /**