forked from Clones/Controlify
✏️ Only print debug info if non-default
This commit is contained in:
@ -22,7 +22,7 @@ public class DebugProperties {
|
||||
public static final boolean PRINT_DRIVER = boolProp("controlify.debug.print_driver", true, true);
|
||||
|
||||
public static void printProperties() {
|
||||
if (properties.stream().noneMatch(DebugProperty::enabled))
|
||||
if (properties.stream().noneMatch(prop -> prop.enabled() != prop.def()))
|
||||
return;
|
||||
|
||||
String header = "*----------------- Controlify Debug Properties -----------------*";
|
||||
@ -42,10 +42,10 @@ public class DebugProperties {
|
||||
private static boolean boolProp(String name, boolean defProd, boolean defDev) {
|
||||
boolean def = FabricLoader.getInstance().isDevelopmentEnvironment() ? defDev : defProd;
|
||||
boolean enabled = Boolean.parseBoolean(System.getProperty(name, Boolean.toString(def)));
|
||||
properties.add(new DebugProperty(name, enabled));
|
||||
properties.add(new DebugProperty(name, enabled, def));
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private record DebugProperty(String name, boolean enabled) {
|
||||
private record DebugProperty(String name, boolean enabled, boolean def) {
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user