From cc8a799438af93161a8c47a71d35b231c5a46f6b Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 2 Feb 2022 12:46:49 +0000 Subject: [PATCH] Added log-full-extension-errors --- .../com/willfp/eco/internal/extensions/EcoExtensionLoader.kt | 4 ++++ eco-core/core-plugin/src/main/resources/config.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/extensions/EcoExtensionLoader.kt b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/extensions/EcoExtensionLoader.kt index d1aab82f..045f8bdb 100644 --- a/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/extensions/EcoExtensionLoader.kt +++ b/eco-core/core-backend/src/main/kotlin/com/willfp/eco/internal/extensions/EcoExtensionLoader.kt @@ -1,6 +1,7 @@ package com.willfp.eco.internal.extensions import com.google.common.collect.ImmutableSet +import com.willfp.eco.core.Eco import com.willfp.eco.core.EcoPlugin import com.willfp.eco.core.config.TransientConfig import com.willfp.eco.core.extensions.Extension @@ -32,6 +33,9 @@ class EcoExtensionLoader( runCatching { loadExtension(extensionJar) }.onFailure { this.plugin.logger.warning(extensionJar.name + " caused an error!") + if (Eco.getHandler().ecoPlugin.configYml.getBool("log-full-extension-errors")) { + it.printStackTrace() + } } } } diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 689c7c78..29c0c480 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -48,6 +48,10 @@ display-frame-ttl: 17 # at a performance penalty. use-safer-namespacedkey-creation: false +# If the stack traces of extensions that failed to load should be logged. Disabled by +# default to prevent users from reporting bugs. Enable if you're a developer. +log-full-extension-errors: false + # Window items packets have the option to be run asynchronously. This may cause # some bugs and is considered experimental, however it has been tested without # any apparent issues. Enable this if performance is absolutely crucial or if you