diff --git a/base/src/main/java/de/staropensource/engine/base/logging/Logger.java b/base/src/main/java/de/staropensource/engine/base/logging/Logger.java index c5834476..bd6f0bdf 100644 --- a/base/src/main/java/de/staropensource/engine/base/logging/Logger.java +++ b/base/src/main/java/de/staropensource/engine/base/logging/Logger.java @@ -137,6 +137,8 @@ public final class Logger { /** * Redirects regular log messages. * + * @param level level of the log call + * @param message message * @since v1-alpha8 */ public static void redirectCall(@NotNull LogLevel level, @NotNull String message) { @@ -146,6 +148,9 @@ public final class Logger { /** * Redirects crash calls. * + * @param message message + * @param throwable {@link Throwable} which caused the error + * @param fatal if to terminate the engine * @since v1-alpha8 */ public static void redirectCall(@NotNull String message, @Nullable Throwable throwable, boolean fatal) { diff --git a/base/src/main/java/de/staropensource/engine/base/logging/backend/CrashHandler.java b/base/src/main/java/de/staropensource/engine/base/logging/backend/CrashHandler.java index 942cc7fe..4ef59897 100644 --- a/base/src/main/java/de/staropensource/engine/base/logging/backend/CrashHandler.java +++ b/base/src/main/java/de/staropensource/engine/base/logging/backend/CrashHandler.java @@ -57,6 +57,13 @@ public final class CrashHandler { "$ git blame", }; + /** + * Creates and initializes an instance of this class. + * + * @since v1-alpha8 + */ + private CrashHandler() {} + /** * Handles crash reports. * diff --git a/base/src/main/java/de/staropensource/engine/base/type/EngineState.java b/base/src/main/java/de/staropensource/engine/base/type/EngineState.java index 75571f26..a83d3bf3 100644 --- a/base/src/main/java/de/staropensource/engine/base/type/EngineState.java +++ b/base/src/main/java/de/staropensource/engine/base/type/EngineState.java @@ -19,8 +19,6 @@ package de.staropensource.engine.base.type; -import de.staropensource.engine.base.logging.Logger; - /** * Determines in which state the engine is currently in. * @@ -28,58 +26,52 @@ import de.staropensource.engine.base.logging.Logger; */ public enum EngineState { /** - * The state of the engine is currently unknown. - * The engine likely has not been initialized yet. + * Indicates that the state of the engine is + * currently unknown. The engine is most likely + * not initialized yet. * * @since v1-alpha2 */ UNKNOWN, /** - * The engine is in early startup. - * The engine is largely uninitialized and - * the logging infrastructure is not yet ready - * to be used. - *
- * This state is used to indicate that the - * {@link InitLogger} shall be used instead - * of {@link Logger}. + * Indicates that the engine is largely + * uninitialized and unsafe to use. * - * @since v1-alpha4 + * @since v1-alpha8 */ EARLY_STARTUP, /** - * The engine is starting up. - * Some parts of the engine may not be initialized - * yet and may be unsafe to access. The logging - * infrastructure is ready to be used though and is - * safe to access. + * Indicates that the core engine has fully + * initialized, except for all subsystems. * - * @since v1-alpha2 + * @since v1-alpha8 */ STARTUP, /** - * The engine is in normal operation mode. + * Indicates that the engine is running + * and operating normally. * * @since v1-alpha2 */ RUNNING, /** - * The engine has crashed, either by itself or the application. + * Indicates that the engine or the + * application has crashed. * * @since v1-alpha2 */ CRASHED, /** - * The engine is shutting down. - * Some parts of the engine may have already - * shut down and may be unsafe to access. + * Indicates that the engine is shutting + * down. The engine is unusable in this + * state and should not be used. * - * @since v1-alpha2 + * @since v1-alpha8 */ SHUTDOWN, } diff --git a/base/src/test/java/de/staropensource/engine/base/srctests/EngineConfigurationTest.java b/base/src/test/java/de/staropensource/engine/base/srctests/EngineConfigurationTest.java index 5599d622..8fd6d362 100644 --- a/base/src/test/java/de/staropensource/engine/base/srctests/EngineConfigurationTest.java +++ b/base/src/test/java/de/staropensource/engine/base/srctests/EngineConfigurationTest.java @@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; import java.util.Properties; +import java.util.Set; import static org.junit.jupiter.api.Assertions.*; @@ -53,11 +54,10 @@ class EngineConfigurationTest extends TestBase { settings.put("debug", new Object[]{ "true", Boolean.TRUE }); settings.put("debugEvents", new Object[]{ "true", Boolean.TRUE }); settings.put("errorShortcodeParser", new Object[]{ "false", Boolean.FALSE }); - settings.put("loggerLevel", new Object[]{ "verbose", LogLevel.VERBOSE }); - settings.put("loggerTemplate", new Object[]{ "%log_path% says: %message%", "%log_path% says: %message%" }); - settings.put("loggerImmediateShutdown", new Object[]{ "true", Boolean.TRUE }); - settings.put("loggerForceStandardOutput", new Object[]{ "true", Boolean.TRUE }); - settings.put("loggerPollingSpeed", new Object[]{ "9999", 9999 }); + settings.put("logLevel", new Object[]{ "verbose", LogLevel.VERBOSE }); + settings.put("logFeatures", new Object[]{ "formatting,runtime,time", Set.of("formatting", "runtime", "time") }); + settings.put("logForceStandardOutput", new Object[]{ "true", Boolean.TRUE }); + settings.put("logPollingSpeed", new Object[]{ "9999", 9999 }); settings.put("optimizeLogging", new Object[]{ "false", Boolean.FALSE }); settings.put("optimizeEvents", new Object[]{ "false", Boolean.FALSE }); diff --git a/notification/src/main/java/de/staropensource/engine/notification/NotificationSubsystem.java b/notification/src/main/java/de/staropensource/engine/notification/NotificationSubsystem.java index 73405401..b2558ff9 100644 --- a/notification/src/main/java/de/staropensource/engine/notification/NotificationSubsystem.java +++ b/notification/src/main/java/de/staropensource/engine/notification/NotificationSubsystem.java @@ -22,6 +22,7 @@ package de.staropensource.engine.notification; import de.staropensource.engine.base.annotation.EngineSubsystem; import de.staropensource.engine.base.implementable.SubsystemClass; import de.staropensource.engine.base.implementation.versioning.StarOpenSourceVersioningSystem; +import de.staropensource.engine.base.logging.Logger; import de.staropensource.engine.base.type.DependencyVector; import de.staropensource.engine.base.utility.information.EngineInformation; import lombok.Getter;