mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@39203a65 [ci/skip] Publish PR API and dev bundles (#12672) PaperMC/Paper@a1b30587 Provide env environment variable and copy spigots sys prop for overriding default repository Purpur Changes: PurpurMC/Purpur@b1d412fb Updated Upstream (Paper) PurpurMC/Purpur@293e28a0 use empty registryaccess where context is not needed, closes #1676 PurpurMC/Purpur@452bb319 port PaperMC/Paper#12654, closes #1665 PurpurMC/Purpur@849bc79c register test subcommands used for debugging, closes #1675 PurpurMC/Purpur@61d7f559 Updated Upstream (Paper)
85 lines
4.5 KiB
Diff
85 lines
4.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Tue, 8 Aug 2023 18:39:55 +0200
|
|
Subject: [PATCH] Do not log plugin library loads
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Add log suppression for LibraryLoader"
|
|
By: Krakenied <Krakenied1@gmail.com>
|
|
As part of: Purpur (https://github.com/PurpurMC/Purpur)
|
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
* Purpur copyright *
|
|
|
|
MIT License
|
|
|
|
Copyright (c) 2019-2022 PurpurMC
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
index 163e9a0e179dc88be93614ff66ee2be3eccc694f..539786355ac89b5eb8ad876e65662e844d4654e3 100644
|
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
@@ -54,6 +54,13 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
private final List<PluginClassLoader> loaders = new CopyOnWriteArrayList<PluginClassLoader>();
|
|
private final LibraryLoader libraryLoader;
|
|
|
|
+ // Gale start - Purpur - do not log plugin library loads
|
|
+ public static boolean SuppressLibraryLoaderLogger = false; // This is not set by Gale, but is included for compatibility with Purpur plugins
|
|
+ public static boolean logDownloads = true;
|
|
+ public static boolean logStartLoadLibrariesForPlugin = true;
|
|
+ public static boolean logLibraryLoaded = true;
|
|
+ // Gale end - Purpur - do not log plugin library loads
|
|
+
|
|
/**
|
|
* This class was not meant to be constructed explicitly
|
|
*
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
|
index 7e4e702845f61703f0741add59f7cfc0afea1543..23e3fcc8c2d6e0555448295199eee186de619042 100644
|
|
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
|
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
|
@@ -77,6 +77,7 @@ public class LibraryLoader {
|
|
session.setTransferListener(new AbstractTransferListener() {
|
|
@Override
|
|
public void transferStarted(@NotNull TransferEvent event) {
|
|
+ if (JavaPluginLoader.logDownloads && !JavaPluginLoader.SuppressLibraryLoaderLogger) // Gale - Purpur - do not log plugin library loads
|
|
logger.log(Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
|
|
}
|
|
});
|
|
@@ -102,6 +103,7 @@ public class LibraryLoader {
|
|
// Paper end - plugin loader api
|
|
return null;
|
|
}
|
|
+ if (JavaPluginLoader.logStartLoadLibrariesForPlugin && !JavaPluginLoader.SuppressLibraryLoaderLogger) // Gale - Purpur - do not log plugin library loads
|
|
logger.log(Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
|
|
{
|
|
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
|
|
@@ -154,6 +156,7 @@ public class LibraryLoader {
|
|
}
|
|
|
|
jarFiles.add(url);
|
|
+ if (JavaPluginLoader.logLibraryLoaded && !JavaPluginLoader.SuppressLibraryLoaderLogger) // Gale - Purpur - do not log plugin library loads
|
|
logger.log(Level.INFO, "[{0}] Loaded library {1}", new Object[]
|
|
{
|
|
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|