diff --git a/bukkit/src/main/java/com/discordsrv/bukkit/DiscordSRVBukkitBootstrap.java b/bukkit/src/main/java/com/discordsrv/bukkit/DiscordSRVBukkitBootstrap.java index 06e4684b..73e2adab 100644 --- a/bukkit/src/main/java/com/discordsrv/bukkit/DiscordSRVBukkitBootstrap.java +++ b/bukkit/src/main/java/com/discordsrv/bukkit/DiscordSRVBukkitBootstrap.java @@ -91,6 +91,11 @@ public class DiscordSRVBukkitBootstrap extends BukkitBootstrap implements IBoots return getClasspathAppender(); } + @Override + public ClassLoader classLoader() { + return getClassLoader(); + } + @Override public LifecycleManager lifecycleManager() { return lifecycleManager; diff --git a/bungee/src/main/java/com/discordsrv/bungee/DiscordSRVBungeeBootstrap.java b/bungee/src/main/java/com/discordsrv/bungee/DiscordSRVBungeeBootstrap.java index 978fe775..3f73a5bc 100644 --- a/bungee/src/main/java/com/discordsrv/bungee/DiscordSRVBungeeBootstrap.java +++ b/bungee/src/main/java/com/discordsrv/bungee/DiscordSRVBungeeBootstrap.java @@ -68,6 +68,11 @@ public class DiscordSRVBungeeBootstrap extends BungeeBootstrap implements IBoots return getClasspathAppender(); } + @Override + public ClassLoader classLoader() { + return getClassLoader(); + } + @Override public LifecycleManager lifecycleManager() { return lifecycleManager; diff --git a/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java b/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java index 5aa65fea..4769e8da 100644 --- a/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java +++ b/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java @@ -33,16 +33,16 @@ import com.discordsrv.common.command.game.GameCommandModule; import com.discordsrv.common.component.ComponentFactory; import com.discordsrv.common.config.connection.ConnectionConfig; import com.discordsrv.common.config.connection.UpdateConfig; -import com.discordsrv.common.config.main.linking.LinkedAccountConfig; import com.discordsrv.common.config.main.MainConfig; +import com.discordsrv.common.config.main.linking.LinkedAccountConfig; import com.discordsrv.common.config.manager.ConnectionConfigManager; import com.discordsrv.common.config.manager.MainConfigManager; import com.discordsrv.common.debug.data.VersionInfo; import com.discordsrv.common.dependency.DiscordSRVDependencyManager; import com.discordsrv.common.discord.api.DiscordAPIEventModule; import com.discordsrv.common.discord.api.DiscordAPIImpl; -import com.discordsrv.common.discord.connection.jda.JDAConnectionManager; import com.discordsrv.common.discord.connection.details.DiscordConnectionDetailsImpl; +import com.discordsrv.common.discord.connection.jda.JDAConnectionManager; import com.discordsrv.common.event.bus.EventBusImpl; import com.discordsrv.common.exception.StorageException; import com.discordsrv.common.function.CheckedFunction; @@ -91,6 +91,7 @@ import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Constructor; import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Path; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -208,10 +209,18 @@ public abstract class AbstractDiscordSRV contents = new ArrayList<>(2); + if (message != null) { + contents.add(message); + } + if (throwable != null) { + // Exceptions aren't always logged correctly by the logger itself + contents.add(ExceptionUtils.getStackTrace(throwable)); + } + logger.log(logLevel, String.join("\n", contents)); } } diff --git a/common/src/test/java/com/discordsrv/common/MockDiscordSRV.java b/common/src/test/java/com/discordsrv/common/MockDiscordSRV.java index af1a9cfe..c19e51d7 100644 --- a/common/src/test/java/com/discordsrv/common/MockDiscordSRV.java +++ b/common/src/test/java/com/discordsrv/common/MockDiscordSRV.java @@ -65,6 +65,11 @@ public class MockDiscordSRV extends AbstractDiscordSRV