mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 09:21:57 +01:00
2f95e1a840
Fix empty `ench` tags being wiped by the meta system SpigotMC/Spigot@cc9a1a417f Add Hunger Config Values SpigotMC/Spigot@2cd515e224 Make debug logging togglable SpigotMC/Spigot@d31b1d616f Spigot has implemented a system of hunger exhaustion similar to ours, as such a lot of config values have been moved there. Our exhaustion patch has been trimmed and only a few values for exhaustion remain in paper.yml, the others now sit in spigot.yml
65 lines
No EOL
2.6 KiB
Diff
65 lines
No EOL
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Minecrell <dev@minecrell.net>
|
|
Date: Sun, 17 Aug 2014 12:42:53 +0200
|
|
Subject: [PATCH] Make debug logging togglable.
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.server.AttributeRanged;
|
|
import net.minecraft.server.GenericAttributes;
|
|
import net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap;
|
|
import net.minecraft.server.MinecraftServer;
|
|
+import org.apache.logging.log4j.LogManager;
|
|
+import org.apache.logging.log4j.core.LoggerContext;
|
|
+import org.apache.logging.log4j.core.config.Configuration;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.command.Command;
|
|
@@ -0,0 +0,0 @@ public class SpigotConfig
|
|
URL.setURLStreamHandlerFactory(new CachedStreamHandlerFactory());
|
|
}
|
|
}
|
|
+
|
|
+ public static boolean debug;
|
|
+ private static void debug()
|
|
+ {
|
|
+ debug = getBoolean( "settings.debug", false );
|
|
+
|
|
+ if ( debug && !LogManager.getRootLogger().isTraceEnabled() )
|
|
+ {
|
|
+ // Enable debug logging
|
|
+ LoggerContext ctx = (LoggerContext) LogManager.getContext( false );
|
|
+ Configuration conf = ctx.getConfiguration();
|
|
+ conf.getLoggerConfig( LogManager.ROOT_LOGGER_NAME ).setLevel( org.apache.logging.log4j.Level.ALL );
|
|
+ ctx.updateLoggers( conf );
|
|
+ }
|
|
+
|
|
+ if ( LogManager.getRootLogger().isTraceEnabled() )
|
|
+ {
|
|
+ Bukkit.getLogger().info( "Debug logging is enabled" );
|
|
+ } else
|
|
+ {
|
|
+ Bukkit.getLogger().info( "Debug logging is disabled" );
|
|
+ }
|
|
+ }
|
|
}
|
|
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/resources/log4j2.xml
|
|
+++ b/src/main/resources/log4j2.xml
|
|
@@ -0,0 +0,0 @@
|
|
<filters>
|
|
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
|
</filters>
|
|
- <AppenderRef ref="WINDOWS_COMPAT"/>
|
|
+ <AppenderRef ref="WINDOWS_COMPAT" level="info"/>
|
|
<AppenderRef ref="File"/>
|
|
- <AppenderRef ref="TerminalConsole"/>
|
|
+ <AppenderRef ref="TerminalConsole" level="info"/>
|
|
</Root>
|
|
</Loggers>
|
|
</Configuration>
|
|
--
|