From c08f660e2e507292e77f01193785dc38e80cf8f6 Mon Sep 17 00:00:00 2001 From: weisj Date: Sat, 23 May 2020 22:23:37 +0200 Subject: [PATCH] Fixed log formatting for library loggers. --- .../github/weisj/darklaf/platform/macos/MacOSLibrary.java | 3 ++- .../github/weisj/darklaf/platform/AbstractLibrary.java | 8 ++++++-- .../weisj/darklaf/platform/windows/WindowsLibrary.java | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/MacOSLibrary.java b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/MacOSLibrary.java index e0b33adb..f587c690 100644 --- a/macos/src/main/java/com/github/weisj/darklaf/platform/macos/MacOSLibrary.java +++ b/macos/src/main/java/com/github/weisj/darklaf/platform/macos/MacOSLibrary.java @@ -25,6 +25,7 @@ package com.github.weisj.darklaf.platform.macos; import com.github.weisj.darklaf.platform.AbstractLibrary; +import com.github.weisj.darklaf.util.LogUtil; import com.github.weisj.darklaf.util.SystemInfo; public class MacOSLibrary extends AbstractLibrary { @@ -38,7 +39,7 @@ public class MacOSLibrary extends AbstractLibrary { } protected MacOSLibrary() { - super(PATH, DLL_NAME); + super(PATH, DLL_NAME, LogUtil.getLogger(MacOSLibrary.class)); } @Override diff --git a/native-utils/src/main/java/com/github/weisj/darklaf/platform/AbstractLibrary.java b/native-utils/src/main/java/com/github/weisj/darklaf/platform/AbstractLibrary.java index 0ace4148..68368c01 100644 --- a/native-utils/src/main/java/com/github/weisj/darklaf/platform/AbstractLibrary.java +++ b/native-utils/src/main/java/com/github/weisj/darklaf/platform/AbstractLibrary.java @@ -35,10 +35,14 @@ public abstract class AbstractLibrary { private boolean loaded; private boolean attemptedLoad; - protected AbstractLibrary(final String path, final String libraryName) { + public AbstractLibrary(final String path, final String libraryName) { + this(path, libraryName, Logger.getLogger(libraryName)); + } + + public AbstractLibrary(final String path, final String libraryName, final Logger logger) { this.path = path; this.libraryName = libraryName; - logger = Logger.getLogger(libraryName); + this.logger = logger; } /** diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsLibrary.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsLibrary.java index a3780aed..daa25bff 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsLibrary.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/WindowsLibrary.java @@ -25,6 +25,7 @@ package com.github.weisj.darklaf.platform.windows; import com.github.weisj.darklaf.platform.AbstractLibrary; +import com.github.weisj.darklaf.util.LogUtil; import com.github.weisj.darklaf.util.SystemInfo; public class WindowsLibrary extends AbstractLibrary { @@ -40,7 +41,7 @@ public class WindowsLibrary extends AbstractLibrary { } protected WindowsLibrary() { - super(PATH, DLL_NAME); + super(PATH, DLL_NAME, LogUtil.getLogger(WindowsLibrary.class)); } @Override