From 9e4cfee89ae2fd141a7f1eda30ce706972e8f22f Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 27 Jun 2024 19:26:25 +0200 Subject: [PATCH] Fix codepart identification for logger instances --- .../staropensource/sosengine/base/utility/PropertyParser.java | 3 ++- .../sosengine/base/utility/ShortcodeConverter.java | 2 +- .../sosengine/graphics/opengl/OpenGlSubsystem.java | 3 ++- .../sosengine/graphics/opengl/classes/Window.java | 4 ++-- .../staropensource/sosengine/graphics/GraphicsSubsystem.java | 3 ++- .../sosengine/graphics/vulkan/VulkanSubsystem.java | 3 ++- .../sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java | 3 ++- .../main/java/de/staropensource/sosengine/testapp/Main.java | 3 ++- 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java b/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java index d8ae16b..24dd6c2 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java @@ -20,6 +20,7 @@ package de.staropensource.sosengine.base.utility; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import lombok.Getter; import org.jetbrains.annotations.NotNull; @@ -85,7 +86,7 @@ public class PropertyParser { */ public PropertyParser(@NotNull Properties properties) { this.properties = properties; - this.logger = new LoggerInstance(new LogIssuer(getClass(), String.valueOf(properties.hashCode()))); + this.logger = new LoggerInstance(new LogIssuer(getClass(), String.valueOf(properties.hashCode()), CodePart.ENGINE)); } /** diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java b/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java index 0f2820f..7c2e6b6 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java @@ -59,7 +59,7 @@ public class ShortcodeConverter { * @see LoggerInstance * @since 1-alpha0 */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * Constructor. diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java index f19cacc..f3f8690 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java @@ -23,6 +23,7 @@ import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.helpers.EventHelper; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.GraphicsSubsystem; @@ -63,7 +64,7 @@ public final class OpenGlSubsystem implements ApiMainClass { * @see LoggerInstance * @since 1-alpha0 */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * The Graphics API's management class. diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java index 1a1fcf0..0ab7276 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/Window.java @@ -21,12 +21,12 @@ package de.staropensource.sosengine.graphics.opengl.classes; import de.staropensource.sosengine.base.classes.types.Vec2i; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.graphics.events.GraphicsApiErrorEvent; import lombok.Getter; import org.jetbrains.annotations.NotNull; import org.lwjgl.opengl.GL; -import org.lwjgl.system.MemoryUtil; import java.util.HashSet; import java.util.Set; @@ -61,7 +61,7 @@ public class Window implements de.staropensource.sosengine.graphics.classes.Wind * @see LoggerInstance * @since 1-alpha0 */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * The window name. diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java index add4873..c5c7416 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java @@ -25,6 +25,7 @@ import de.staropensource.sosengine.base.classes.SubsystemMainClass; import de.staropensource.sosengine.base.classes.helpers.EventHelper; import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.base.utility.ListFormatter; import de.staropensource.sosengine.base.utility.Miscellaneous; @@ -63,7 +64,7 @@ public final class GraphicsSubsystem implements SubsystemMainClass { * @see LoggerInstance * @since 1-alpha0 */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * A list of all registered Graphics APIs. diff --git a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java index a559a67..2a86e5a 100644 --- a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java +++ b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java @@ -22,6 +22,7 @@ package de.staropensource.sosengine.graphics.vulkan; import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.GraphicsSubsystem; @@ -60,7 +61,7 @@ public final class VulkanSubsystem implements ApiMainClass { * @see LoggerInstance * @since 1-alpha0 */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * The Graphics API management class. diff --git a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java index 94e4ee6..1fb5ba9 100644 --- a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java +++ b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java @@ -22,6 +22,7 @@ package de.staropensource.sosengine.slf4j_compat; import de.staropensource.sosengine.base.classes.SubsystemMainClass; import de.staropensource.sosengine.base.events.LogEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import lombok.Getter; import org.slf4j.LoggerFactory; @@ -49,7 +50,7 @@ public class Slf4jCompatibilitySubsystem implements SubsystemMainClass { private static Slf4jCompatibilitySubsystem instance = null; /** {@inheritDoc} */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.ENGINE)); /** * Constructor. diff --git a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java index b614afc..e81c7ef 100644 --- a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java +++ b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java @@ -22,6 +22,7 @@ package de.staropensource.sosengine.testapp; import de.staropensource.sosengine.base.Engine; import de.staropensource.sosengine.base.classes.types.Vec2i; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.CodePart; import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.graphics.GraphicsSubsystem; import de.staropensource.sosengine.graphics.classes.ApiMainClass; @@ -67,7 +68,7 @@ public class Main { * * @see LoggerInstance */ - private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass())); + private final LoggerInstance logger = new LoggerInstance(new LogIssuer(getClass(), CodePart.APPLICATION)); /** * Constructor.