Added option to disable StarMap logs

This commit is contained in:
LemADEC 2016-04-20 20:28:15 +02:00
parent c0fb056d59
commit c853ec81e7
3 changed files with 10 additions and 4 deletions

View file

@ -389,7 +389,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
} else { } else {
isolationRate = 0.0D; isolationRate = 0.0D;
} }
if (WarpDriveConfig.LOGGING_JUMPBLOCKS) { if (WarpDriveConfig.LOGGING_RADAR) {
WarpDrive.logger.info(this + " Isolation updated to " + isolationBlocksCount + " (" + String.format("%.1f", isolationRate * 100.0) + "%)"); WarpDrive.logger.info(this + " Isolation updated to " + isolationBlocksCount + " (" + String.format("%.1f", isolationRate * 100.0) + "%)");
} }
} }

View file

@ -141,6 +141,7 @@ public class WarpDriveConfig {
public static boolean LOGGING_WORLDGEN = false; public static boolean LOGGING_WORLDGEN = false;
public static boolean LOGGING_PROFILING = true; public static boolean LOGGING_PROFILING = true;
public static boolean LOGGING_DICTIONARY = false; public static boolean LOGGING_DICTIONARY = false;
public static boolean LOGGING_STARMAP = false;
// Planets // Planets
public static Planet[] PLANETS = null; public static Planet[] PLANETS = null;
@ -422,6 +423,7 @@ public class WarpDriveConfig {
LOGGING_WORLDGEN = config.get("logging", "enable_worldgen_logs", LOGGING_WORLDGEN, "Detailled world generation logs to help debug the mod, enable it before reporting a bug").getBoolean(false); LOGGING_WORLDGEN = config.get("logging", "enable_worldgen_logs", LOGGING_WORLDGEN, "Detailled world generation logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
LOGGING_PROFILING = config.get("logging", "enable_profiling_logs", LOGGING_PROFILING, "Profiling logs, enable it to check for lag").getBoolean(true); LOGGING_PROFILING = config.get("logging", "enable_profiling_logs", LOGGING_PROFILING, "Profiling logs, enable it to check for lag").getBoolean(true);
LOGGING_DICTIONARY = config.get("logging", "enable_dictionary_logs", LOGGING_PROFILING, "Dictionary logs, enable it to dump blocks hardness and blast resistance at boot").getBoolean(true); LOGGING_DICTIONARY = config.get("logging", "enable_dictionary_logs", LOGGING_PROFILING, "Dictionary logs, enable it to dump blocks hardness and blast resistance at boot").getBoolean(true);
LOGGING_STARMAP = config.get("logging", "enable_starmap_logs", LOGGING_PROFILING, "Starmap logs, enable it to dump starmap registry updates").getBoolean(false);
// Planets // Planets
{ {

View file

@ -55,18 +55,22 @@ public class StarMapRegistry {
registry.set(idx, entryKey); registry.set(idx, entryKey);
} else { } else {
registry.add(entryKey); registry.add(entryKey);
if (WarpDriveConfig.LOGGING_STARMAP) {
printRegistry("added"); printRegistry("added");
} }
} }
}
public void removeFromRegistry(StarMapEntry entryKey) { public void removeFromRegistry(StarMapEntry entryKey) {
int idx = searchInRegistry(entryKey); int idx = searchInRegistry(entryKey);
if (idx != -1) { if (idx != -1) {
registry.remove(idx); registry.remove(idx);
if (WarpDriveConfig.LOGGING_STARMAP) {
printRegistry("removed"); printRegistry("removed");
} }
} }
}
public ArrayList<StarMapEntry> radarScan(TileEntity tileEntity, final int radius) { public ArrayList<StarMapEntry> radarScan(TileEntity tileEntity, final int radius) {
ArrayList<StarMapEntry> res = new ArrayList<StarMapEntry>(registry.size()); ArrayList<StarMapEntry> res = new ArrayList<StarMapEntry>(registry.size());
@ -205,7 +209,7 @@ public class StarMapRegistry {
} }
if (!isValid) { if (!isValid) {
if (WarpDriveConfig.LOGGING_JUMP) { if (WarpDriveConfig.LOGGING_STARMAP) {
if (entry == null) { if (entry == null) {
WarpDrive.logger.info("Cleaning up starmap object ~null~"); WarpDrive.logger.info("Cleaning up starmap object ~null~");
} else { } else {