Paper/CraftBukkit-Patches/0026-Allow-Disabling-of-Command-Logging.patch

37 lines
1.5 KiB
Diff
Raw Normal View History

2016-03-14 06:57:03 +01:00
From 2467f472fd780075961558c3f14cd3cde2f51dcb Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 18:01:29 +1000
Subject: [PATCH] Allow Disabling of Command Logging
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
2016-03-14 06:57:03 +01:00
index 76cbb21..7d98d67 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2016-03-14 06:57:03 +01:00
@@ -1284,6 +1284,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
2015-02-28 12:36:22 +01:00
private void handleCommand(String s) {
org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
2014-11-28 02:17:45 +01:00
// CraftBukkit start - whole method
+ if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
2016-02-29 22:33:06 +01:00
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
CraftPlayer player = this.getPlayer();
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index dcca493..3999f5b 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -149,4 +149,10 @@ public class SpigotConfig
config.addDefault( path, def );
return config.getDouble( path, config.getDouble( path ) );
}
+
+ public static boolean logCommands;
+ private static void logCommands()
+ {
+ logCommands = getBoolean( "commands.log", true );
+ }
}
--
2016-02-29 22:33:06 +01:00
2.5.0