Paper/Spigot-API-Patches/0040-Add-debug-logging-to-Timings-enable-setter.patch

26 lines
972 B
Diff
Raw Normal View History

2016-10-26 23:05:22 +02:00
From 582c0de7289fb70e00150ae60d41ec6b7730d1c9 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 26 Oct 2016 15:49:28 -0500
Subject: [PATCH] Add debug logging to Timings enable setter
Potentially temporary, will be merged back into main Timings patch if not.
`java -Dtimings.throwOnChange=true -jar paperclip.jar`
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
index 4e5cf35..bef7cf7 100644
--- a/src/main/java/co/aikar/timings/Timings.java
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -128,6 +128,9 @@ public final class Timings {
public static void setTimingsEnabled(boolean enabled) {
timingsEnabled = enabled;
reset();
+ if (Boolean.getBoolean("timings.throwOnChange")) {
+ new RuntimeException("The enable state of timings has been changed to: " + enabled).printStackTrace();
+ }
}
/**
--
2.10.0.windows.1