Cleanup logging system

This commit is contained in:
N0tMyFaultOG 2020-08-18 15:50:28 +02:00
parent b6e7f90f6a
commit 352136f0c6
32 changed files with 250 additions and 250 deletions

View File

@ -257,12 +257,12 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
if (PremiumVerification.isPremium()) { if (PremiumVerification.isPremium()) {
logger.info("[P2] PlotSquared version licensed to Spigot user {}", getUserID()); logger.info("PlotSquared version licensed to Spigot user {}", getUserID());
logger.info("[P2] https://www.spigotmc.org/resources/{}", getResourceID()); logger.info("https://www.spigotmc.org/resources/{}", getResourceID());
logger.info("[P2] Download ID: {}", getDownloadID()); logger.info("Download ID: {}", getDownloadID());
logger.info("[P2] Thanks for supporting us :)"); logger.info("Thanks for supporting us :)");
} else { } else {
logger.info("[P2] Couldn't verify purchase :("); logger.info("Couldn't verify purchase :(");
} }
// Database // Database
@ -274,7 +274,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
if (!plotSquared.getConfigurationVersion().equalsIgnoreCase("v5")) { if (!plotSquared.getConfigurationVersion().equalsIgnoreCase("v5")) {
// Perform upgrade // Perform upgrade
if (DBFunc.dbManager.convertFlags()) { if (DBFunc.dbManager.convertFlags()) {
logger.info("[P2] Flags were converted successfully!"); logger.info("Flags were converted successfully!");
// Update the config version // Update the config version
try { try {
plotSquared.setConfigurationVersion("v5"); plotSquared.setConfigurationVersion("v5");
@ -298,13 +298,13 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
// WorldEdit // WorldEdit
if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) { if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) {
try { try {
logger.info("[P2] {} hooked into WorldEdit", this.getPluginName()); logger.info("{} hooked into WorldEdit", this.getPluginName());
WorldEdit.getInstance().getEventBus().register(this.getInjector().getInstance(WESubscriber.class)); WorldEdit.getInstance().getEventBus().register(this.getInjector().getInstance(WESubscriber.class));
if (Settings.Enabled_Components.COMMANDS) { if (Settings.Enabled_Components.COMMANDS) {
new WE_Anywhere(); new WE_Anywhere();
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] Incompatible version of WorldEdit, please upgrade: https://builds.enginehub.org/job/worldedit?branch=master"); logger.error("Incompatible version of WorldEdit, please upgrade: https://builds.enginehub.org/job/worldedit?branch=master");
} }
} }
@ -347,7 +347,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
try { try {
getInjector().getInstance(ComponentPresetManager.class); getInjector().getInstance(ComponentPresetManager.class);
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to initialize the preset system", e); logger.error("Failed to initialize the preset system", e);
} }
} }
@ -370,11 +370,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
continue; continue;
} }
if (!worldUtil.isWorld(world) && !world.equals("*")) { if (!worldUtil.isWorld(world) && !world.equals("*")) {
logger.warn("[P2] `{}` was not properly loaded - {} will now try to load it properly", world, this.getPluginName()); logger.warn("`{}` was not properly loaded - {} will now try to load it properly", world, this.getPluginName());
logger.warn( logger.warn(
"[P2] - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml"); " - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml");
logger.warn("[P2] - Your world management plugin may be faulty (or non existent)"); logger.warn(" - Your world management plugin may be faulty (or non existent)");
logger.warn("[P2] This message may also be a false positive and could be ignored."); logger.warn(" This message may also be a false positive and could be ignored.");
this.setGenerator(world); this.setGenerator(world);
} }
} }
@ -394,7 +394,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final OfflineModeUUIDService offlineModeUUIDService = new OfflineModeUUIDService(); final OfflineModeUUIDService offlineModeUUIDService = new OfflineModeUUIDService();
this.impromptuPipeline.registerService(offlineModeUUIDService); this.impromptuPipeline.registerService(offlineModeUUIDService);
this.backgroundPipeline.registerService(offlineModeUUIDService); this.backgroundPipeline.registerService(offlineModeUUIDService);
logger.info("[P2] (UUID) Using the offline mode UUID service"); logger.info("(UUID) Using the offline mode UUID service");
} }
if (Settings.UUID.SERVICE_BUKKIT) { if (Settings.UUID.SERVICE_BUKKIT) {
@ -415,7 +415,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final LuckPermsUUIDService luckPermsUUIDService; final LuckPermsUUIDService luckPermsUUIDService;
if (Settings.UUID.SERVICE_LUCKPERMS && Bukkit.getPluginManager().getPlugin("LuckPerms") != null) { if (Settings.UUID.SERVICE_LUCKPERMS && Bukkit.getPluginManager().getPlugin("LuckPerms") != null) {
luckPermsUUIDService = new LuckPermsUUIDService(); luckPermsUUIDService = new LuckPermsUUIDService();
logger.info("[P2] (UUID) Using LuckPerms as a complementary UUID service"); logger.info("(UUID) Using LuckPerms as a complementary UUID service");
} else { } else {
luckPermsUUIDService = null; luckPermsUUIDService = null;
} }
@ -423,7 +423,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final BungeePermsUUIDService bungeePermsUUIDService; final BungeePermsUUIDService bungeePermsUUIDService;
if (Settings.UUID.SERVICE_BUNGEE_PERMS && Bukkit.getPluginManager().getPlugin("BungeePerms") != null) { if (Settings.UUID.SERVICE_BUNGEE_PERMS && Bukkit.getPluginManager().getPlugin("BungeePerms") != null) {
bungeePermsUUIDService = new BungeePermsUUIDService(); bungeePermsUUIDService = new BungeePermsUUIDService();
logger.info("[P2] (UUID) Using BungeePerms as a complementary UUID service"); logger.info("(UUID) Using BungeePerms as a complementary UUID service");
} else { } else {
bungeePermsUUIDService = null; bungeePermsUUIDService = null;
} }
@ -431,7 +431,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final EssentialsUUIDService essentialsUUIDService; final EssentialsUUIDService essentialsUUIDService;
if (Settings.UUID.SERVICE_ESSENTIALSX && Bukkit.getPluginManager().getPlugin("Essentials") != null) { if (Settings.UUID.SERVICE_ESSENTIALSX && Bukkit.getPluginManager().getPlugin("Essentials") != null) {
essentialsUUIDService = new EssentialsUUIDService(); essentialsUUIDService = new EssentialsUUIDService();
logger.info("[P2] (UUID) Using EssentialsX as a complementary UUID service"); logger.info("(UUID) Using EssentialsX as a complementary UUID service");
} else { } else {
essentialsUUIDService = null; essentialsUUIDService = null;
} }
@ -442,7 +442,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final PaperUUIDService paperUUIDService = new PaperUUIDService(); final PaperUUIDService paperUUIDService = new PaperUUIDService();
this.impromptuPipeline.registerService(paperUUIDService); this.impromptuPipeline.registerService(paperUUIDService);
this.backgroundPipeline.registerService(paperUUIDService); this.backgroundPipeline.registerService(paperUUIDService);
logger.info("[P2] (UUID) Using Paper as a complementary UUID service"); logger.info("(UUID) Using Paper as a complementary UUID service");
} }
this.impromptuPipeline.registerService(sqLiteUUIDService); this.impromptuPipeline.registerService(sqLiteUUIDService);
@ -496,9 +496,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
if (Settings.Enabled_Components.EXTERNAL_PLACEHOLDERS) { if (Settings.Enabled_Components.EXTERNAL_PLACEHOLDERS) {
ChatFormatter.formatters.add(getInjector().getInstance(PlaceholderFormatter.class)); ChatFormatter.formatters.add(getInjector().getInstance(PlaceholderFormatter.class));
} }
logger.info("[P2] PlotSquared hooked into PlaceholderAPI"); logger.info("PlotSquared hooked into PlaceholderAPI");
} else { } else {
logger.info("[P2] PlaceholderAPI is not in use. Hook deactivated"); logger.info("PlaceholderAPI is not in use. Hook deactivated");
} }
this.startMetrics(); this.startMetrics();
@ -570,7 +570,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final Chunk[] chunks = world.getLoadedChunks(); final Chunk[] chunks = world.getLoadedChunks();
if (chunks.length == 0) { if (chunks.length == 0) {
if (!Bukkit.unloadWorld(world, true)) { if (!Bukkit.unloadWorld(world, true)) {
logger.warn("[P2] Failed to unload {}", world.getName()); logger.warn("Failed to unload {}", world.getName());
} }
return; return;
} else { } else {
@ -619,7 +619,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
}); });
logger.info("[P2] (UUID) {} UUIDs will be cached", uuidQueue.size()); logger.info("(UUID) {} UUIDs will be cached", uuidQueue.size());
Executors.newSingleThreadScheduledExecutor().schedule(() -> { Executors.newSingleThreadScheduledExecutor().schedule(() -> {
// Begin by reading all the SQLite cache at once // Begin by reading all the SQLite cache at once
@ -627,7 +627,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
// Now fetch names for all known UUIDs // Now fetch names for all known UUIDs
final int totalSize = uuidQueue.size(); final int totalSize = uuidQueue.size();
int read = 0; int read = 0;
logger.info("[P2] (UUID) PlotSquared will fetch UUIDs in groups of {}", Settings.UUID.BACKGROUND_LIMIT); logger.info("(UUID) PlotSquared will fetch UUIDs in groups of {}", Settings.UUID.BACKGROUND_LIMIT);
final List<UUID> uuidList = new ArrayList<>(Settings.UUID.BACKGROUND_LIMIT); final List<UUID> uuidList = new ArrayList<>(Settings.UUID.BACKGROUND_LIMIT);
// Used to indicate that the second retrieval has been attempted // Used to indicate that the second retrieval has been attempted
@ -635,7 +635,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
while (!uuidQueue.isEmpty() || !uuidList.isEmpty()) { while (!uuidQueue.isEmpty() || !uuidList.isEmpty()) {
if (!uuidList.isEmpty() && secondRun) { if (!uuidList.isEmpty() && secondRun) {
logger.warn("[P2] (UUID) Giving up on last batch. Fetching new batch instead"); logger.warn("(UUID) Giving up on last batch. Fetching new batch instead");
uuidList.clear(); uuidList.clear();
} }
if (uuidList.isEmpty()) { if (uuidList.isEmpty()) {
@ -659,13 +659,13 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
// Print progress // Print progress
final double percentage = ((double) read / (double) totalSize) * 100.0D; final double percentage = ((double) read / (double) totalSize) * 100.0D;
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] (UUID) PlotSquared has cached {} of UUIDs", String.format("%.1f%%", percentage)); logger.info("(UUID) PlotSquared has cached {} of UUIDs", String.format("%.1f%%", percentage));
} }
} catch (final InterruptedException | ExecutionException e) { } catch (final InterruptedException | ExecutionException e) {
logger.error("[P2] (UUID) Failed to retrieve last batch. Will try again", e); logger.error("(UUID) Failed to retrieve last batch. Will try again", e);
} }
} }
logger.info("[P2] (UUID) PlotSquared has cached all UUIDs"); logger.info("(UUID) PlotSquared has cached all UUIDs");
}, 10, TimeUnit.SECONDS); }, 10, TimeUnit.SECONDS);
} }
@ -697,7 +697,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
@SuppressWarnings("deprecation") private void runEntityTask() { @SuppressWarnings("deprecation") private void runEntityTask() {
logger.info("[P2] KillAllEntities started"); logger.info("KillAllEntities started");
TaskManager.runTaskRepeat(() -> this.plotAreaManager.forEachPlotArea(plotArea -> { TaskManager.runTaskRepeat(() -> this.plotAreaManager.forEachPlotArea(plotArea -> {
final World world = Bukkit.getWorld(plotArea.getWorldName()); final World world = Bukkit.getWorld(plotArea.getWorldName());
try { try {
@ -1018,7 +1018,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
SetGenCB.setGenerator(BukkitUtil.getWorld(worldName)); SetGenCB.setGenerator(BukkitUtil.getWorld(worldName));
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to reload world: {} | {}", world, e.getMessage()); logger.error("Failed to reload world: {} | {}", world, e.getMessage());
Bukkit.getServer().unloadWorld(world, false); Bukkit.getServer().unloadWorld(world, false);
return; return;
} }

View File

@ -391,7 +391,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
try { try {
entity.getInventory().setContents(this.inventory); entity.getInventory().setContents(this.inventory);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error("[P2] Failed to restore inventory", e); logger.error("Failed to restore inventory", e);
} }
} }
@ -738,7 +738,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
return entity; return entity;
default: default:
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Could not identify entity: {}", entity.getType()); logger.info("Could not identify entity: {}", entity.getType());
} }
return entity; return entity;
// END LIVING // END LIVING

View File

@ -46,8 +46,8 @@ public class BackupModule extends AbstractModule {
.implement(BackupProfile.class, PlayerBackupProfile.class).build(PlayerBackupProfileFactory.class)); .implement(BackupProfile.class, PlayerBackupProfile.class).build(PlayerBackupProfileFactory.class));
bind(BackupManager.class).to(SimpleBackupManager.class); bind(BackupManager.class).to(SimpleBackupManager.class);
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to initialize backup manager", e); logger.error("Failed to initialize backup manager", e);
logger.error("[P2] Backup features will be disabled"); logger.error("Backup features will be disabled");
bind(BackupManager.class).to(NullBackupManager.class); bind(BackupManager.class).to(NullBackupManager.class);
} }
} }

View File

@ -349,7 +349,7 @@ public class BukkitUtil extends WorldUtil {
@Override public void setBiomes(@Nonnull final String worldName, @Nonnull final CuboidRegion region, @Nonnull final BiomeType biomeType) { @Override public void setBiomes(@Nonnull final String worldName, @Nonnull final CuboidRegion region, @Nonnull final BiomeType biomeType) {
final World world = getWorld(worldName); final World world = getWorld(worldName);
if (world == null) { if (world == null) {
logger.warn("[P2] An error occurred while setting the biome because the world was null", new RuntimeException()); logger.warn("An error occurred while setting the biome because the world was null", new RuntimeException());
return; return;
} }
final Biome biome = BukkitAdapter.adapt(biomeType); final Biome biome = BukkitAdapter.adapt(biomeType);
@ -459,7 +459,7 @@ public class BukkitUtil extends WorldUtil {
} }
break; break;
default: { default: {
logger.error("[P2] Unknown entity category requested: {}", category); logger.error("Unknown entity category requested: {}", category);
} }
break; break;
} }

View File

@ -126,7 +126,7 @@ public class ContentMap {
try { try {
entity.spawn(world, xOffset, zOffset); entity.spawn(world, xOffset, zOffset);
} catch (Exception e) { } catch (Exception e) {
logger.error("[P2] Failed to restore entity", e); logger.error("Failed to restore entity", e);
} }
} }
this.entities.clear(); this.entities.clear();

View File

@ -72,22 +72,22 @@ public class UpdateUtility implements Listener {
.getAsJsonObject(); .getAsJsonObject();
spigotVersion = result.get("current_version").getAsString(); spigotVersion = result.get("current_version").getAsString();
} catch (IOException e) { } catch (IOException e) {
logger.error("[P2] Unable to check for updates. Error: {}", e.getMessage()); logger.error("Unable to check for updates. Error: {}", e.getMessage());
return; return;
} }
if (internalVersion.isLaterVersion(spigotVersion)) { if (internalVersion.isLaterVersion(spigotVersion)) {
logger.info("[P2] There appears to be a PlotSquared update available!"); logger.info("There appears to be a PlotSquared update available!");
logger.info("[P2] You are running version {}, the latest version is {}", logger.info("You are running version {}, the latest version is {}",
internalVersion.versionString(), spigotVersion); internalVersion.versionString(), spigotVersion);
logger.info("[P2] https://www.spigotmc.org/resources/77506/updates"); logger.info("https://www.spigotmc.org/resources/77506/updates");
hasUpdate = true; hasUpdate = true;
if (Settings.UpdateChecker.NOTIFY_ONCE) { if (Settings.UpdateChecker.NOTIFY_ONCE) {
cancelTask(); cancelTask();
} }
} else if (notify) { } else if (notify) {
notify = false; notify = false;
logger.info("[P2] Congratulations! You are running the latest PlotSquared version"); logger.info("Congratulations! You are running the latest PlotSquared version");
} }
}, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20); }, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20);
} }

View File

@ -82,7 +82,7 @@ public class SquirrelIdUUIDService implements UUIDService {
// //
if (uuids.size() >= 2) { if (uuids.size() >= 2) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] (UUID) Found invalid UUID in batch. Will try each UUID individually."); logger.info("(UUID) Found invalid UUID in batch. Will try each UUID individually.");
} }
for (final UUID uuid : uuids) { for (final UUID uuid : uuids) {
final List<UUIDMapping> result = this.getNames(Collections.singletonList(uuid)); final List<UUIDMapping> result = this.getNames(Collections.singletonList(uuid));
@ -92,7 +92,7 @@ public class SquirrelIdUUIDService implements UUIDService {
results.add(result.get(0)); results.add(result.get(0));
} }
} else if (uuids.size() == 1 && Settings.DEBUG) { } else if (uuids.size() == 1 && Settings.DEBUG) {
logger.info("[P2] (UUID) Found invalid UUID: {}", uuids.get(0)); logger.info("(UUID) Found invalid UUID: {}", uuids.get(0));
} }
} }
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {

View File

@ -391,16 +391,16 @@ public class PlotSquared {
regionInts.forEach(l -> regions.add(BlockVector2.at(l[0], l[1]))); regionInts.forEach(l -> regions.add(BlockVector2.at(l[0], l[1])));
chunkInts.forEach(l -> chunks.add(BlockVector2.at(l[0], l[1]))); chunkInts.forEach(l -> chunks.add(BlockVector2.at(l[0], l[1])));
int height = (int) list.get(2); int height = (int) list.get(2);
logger.info("[P2] Incomplete road regeneration found. Restarting in world {} with height {}", plotArea.getWorldName(), height); logger.info("Incomplete road regeneration found. Restarting in world {} with height {}", plotArea.getWorldName(), height);
logger.info("[P2] - Regions: {}", regions.size()); logger.info(" - Regions: {}", regions.size());
logger.info("[P2] - Chunks: {}", chunks.size()); logger.info(" - Chunks: {}", chunks.size());
HybridUtils.UPDATE = true; HybridUtils.UPDATE = true;
PlotSquared.platform().getHybridUtils().scheduleRoadUpdate(plotArea, regions, height, chunks); PlotSquared.platform().getHybridUtils().scheduleRoadUpdate(plotArea, regions, height, chunks);
} catch (IOException | ClassNotFoundException e) { } catch (IOException | ClassNotFoundException e) {
logger.error("[P2] Error restarting road regeneration", e); logger.error("Error restarting road regeneration", e);
} finally { } finally {
if (!file.delete()) { if (!file.delete()) {
logger.error("[P2] Error deleting persistent_regen_data_{}. Please delete this file manually", plotArea.getId()); logger.error("Error deleting persistent_regen_data_{}. Please delete this file manually", plotArea.getId());
} }
} }
}); });
@ -803,10 +803,10 @@ public class PlotSquared {
// Conventional plot generator // Conventional plot generator
PlotArea plotArea = plotGenerator.getNewPlotArea(world, null, null, null); PlotArea plotArea = plotGenerator.getNewPlotArea(world, null, null, null);
PlotManager plotManager = plotArea.getPlotManager(); PlotManager plotManager = plotArea.getPlotManager();
logger.info("[P2] Detected world load for '{}'", world); logger.info("Detected world load for '{}'", world);
logger.info("[P2] - generator: {}>{}", baseGenerator, plotGenerator); logger.info(" - generator: {}>{}", baseGenerator, plotGenerator);
logger.info("[P2] - plot world: {}", plotArea.getClass().getCanonicalName()); logger.info(" - plot world: {}", plotArea.getClass().getCanonicalName());
logger.info("[P2] - plot area manager: {}", plotManager.getClass().getCanonicalName()); logger.info("- plot area manager: {}", plotManager.getClass().getCanonicalName());
if (!this.worldConfiguration.contains(path)) { if (!this.worldConfiguration.contains(path)) {
this.worldConfiguration.createSection(path); this.worldConfiguration.createSection(path);
worldSection = this.worldConfiguration.getConfigurationSection(path); worldSection = this.worldConfiguration.getConfigurationSection(path);
@ -830,7 +830,7 @@ public class PlotSquared {
if (getPlotAreaManager().getPlotAreas(world, null).length != 0) { if (getPlotAreaManager().getPlotAreas(world, null).length != 0) {
return; return;
} }
logger.info("[P2] Detected world load for '{}'", world); logger.info("Detected world load for '{}'", world);
String gen_string = worldSection.getString("generator.plugin", platform.getPluginName()); String gen_string = worldSection.getString("generator.plugin", platform.getPluginName());
if (type == PlotAreaType.PARTIAL) { if (type == PlotAreaType.PARTIAL) {
Set<PlotCluster> clusters = Set<PlotCluster> clusters =
@ -846,7 +846,7 @@ public class PlotSquared {
String fullId = name + "-" + pos1 + "-" + pos2; String fullId = name + "-" + pos1 + "-" + pos2;
worldSection.createSection("areas." + fullId); worldSection.createSection("areas." + fullId);
DBFunc.replaceWorld(world, world + ";" + name, pos1, pos2); // NPE DBFunc.replaceWorld(world, world + ";" + name, pos1, pos2); // NPE
logger.info("[P2] - {}-{}-{}", name, pos1, pos2); logger.info(" - {}-{}-{}", name, pos1, pos2);
GeneratorWrapper<?> areaGen = this.platform.getGenerator(world, gen_string); GeneratorWrapper<?> areaGen = this.platform.getGenerator(world, gen_string);
if (areaGen == null) { if (areaGen == null) {
throw new IllegalArgumentException("Invalid Generator: " + gen_string); throw new IllegalArgumentException("Invalid Generator: " + gen_string);
@ -860,10 +860,10 @@ public class PlotSquared {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
logger.info("[P2] | generator: {}>{}", baseGenerator, areaGen); logger.info(" | generator: {}>{}", baseGenerator, areaGen);
logger.info("[P2] | plot world: {}", pa); logger.info(" | plot world: {}", pa);
logger.info("[P2] | manager: {}", pa); logger.info(" | manager: {}", pa);
logger.info("[P2] Note: Area created for cluster '{}' (invalid or old configuration?)", name); logger.info("Note: Area created for cluster '{}' (invalid or old configuration?)", name);
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
toLoad.add(pa); toLoad.add(pa);
@ -885,9 +885,9 @@ public class PlotSquared {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
logger.info("[P2] - generator: {}>{}", baseGenerator, areaGen); logger.info(" - generator: {}>{}", baseGenerator, areaGen);
logger.info("[P2] - plot world: {}", pa); logger.info(" - plot world: {}", pa);
logger.info("[P2] - plot area manager: {}", pa.getPlotManager()); logger.info(" - plot area manager: {}", pa.getPlotManager());
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
addPlotArea(pa); addPlotArea(pa);
@ -899,7 +899,7 @@ public class PlotSquared {
+ PlotAreaType.AUGMENTED + "`"); + PlotAreaType.AUGMENTED + "`");
} }
for (String areaId : areasSection.getKeys(false)) { for (String areaId : areasSection.getKeys(false)) {
logger.info("[P2] - {}", areaId); logger.info(" - {}", areaId);
String[] split = areaId.split("(?<=[^;-])-"); String[] split = areaId.split("(?<=[^;-])-");
if (split.length != 3) { if (split.length != 3) {
throw new IllegalArgumentException("Invalid Area identifier: " + areaId throw new IllegalArgumentException("Invalid Area identifier: " + areaId
@ -961,10 +961,10 @@ public class PlotSquared {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
logger.info("[P2] Detected area load for '{}'", world); logger.info("Detected area load for '{}'", world);
logger.info("[P2] | generator: {}>{}", baseGenerator, areaGen); logger.info(" | generator: {}>{}", baseGenerator, areaGen);
logger.info("[P2] | plot world: {}", pa); logger.info(" | plot world: {}", pa);
logger.info("[P2] | manager: {}", pa.getPlotManager()); logger.info(" | manager: {}", pa.getPlotManager());
areaGen.getPlotGenerator().initialize(pa); areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa); areaGen.augment(pa);
addPlotArea(pa); addPlotArea(pa);
@ -1035,7 +1035,7 @@ public class PlotSquared {
for (String element : split) { for (String element : split) {
String[] pair = element.split("="); String[] pair = element.split("=");
if (pair.length != 2) { if (pair.length != 2) {
logger.error("[P2] No value provided for '{}'", element); logger.error("No value provided for '{}'", element);
return false; return false;
} }
String key = pair[0].toLowerCase(); String key = pair[0].toLowerCase();
@ -1083,11 +1083,11 @@ public class PlotSquared {
ConfigurationUtil.BLOCK_BUCKET.parseString(value).toString()); ConfigurationUtil.BLOCK_BUCKET.parseString(value).toString());
break; break;
default: default:
logger.error("[P2] Key not found: {}", element); logger.error("Key not found: {}", element);
return false; return false;
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("[P2] Invalid value '{}' for arg '{}'", value, element); logger.error("Invalid value '{}' for arg '{}'", value, element);
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@ -1155,7 +1155,7 @@ public class PlotSquared {
} }
} }
} catch (IOException e) { } catch (IOException e) {
logger.error("[P2] Could not save {}", file); logger.error("Could not save {}", file);
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -1178,7 +1178,7 @@ public class PlotSquared {
// Close the connection // Close the connection
DBFunc.close(); DBFunc.close();
} catch (NullPointerException throwable) { } catch (NullPointerException throwable) {
logger.error("[P2] Could not close database connection", throwable); logger.error("Could not close database connection", throwable);
throwable.printStackTrace(); throwable.printStackTrace();
} }
} }
@ -1191,9 +1191,9 @@ public class PlotSquared {
HybridUtils.regions.isEmpty() && HybridUtils.chunks.isEmpty())) { HybridUtils.regions.isEmpty() && HybridUtils.chunks.isEmpty())) {
return; return;
} }
logger.info("[P2] Road regeneration incomplete. Saving incomplete regions to disk"); logger.info("Road regeneration incomplete. Saving incomplete regions to disk");
logger.info("[P2] - regions: {}", HybridUtils.regions.size()); logger.info(" - regions: {}", HybridUtils.regions.size());
logger.info("[P2] - chunks: {}", HybridUtils.chunks.size()); logger.info(" - chunks: {}", HybridUtils.chunks.size());
ArrayList<int[]> regions = new ArrayList<>(); ArrayList<int[]> regions = new ArrayList<>();
ArrayList<int[]> chunks = new ArrayList<>(); ArrayList<int[]> chunks = new ArrayList<>();
for (BlockVector2 r : HybridUtils.regions) { for (BlockVector2 r : HybridUtils.regions) {
@ -1210,14 +1210,14 @@ public class PlotSquared {
this.platform.getDirectory() + File.separator + "persistent_regen_data_" + HybridUtils.area this.platform.getDirectory() + File.separator + "persistent_regen_data_" + HybridUtils.area
.getId() + "_" + HybridUtils.area.getWorldName()); .getId() + "_" + HybridUtils.area.getWorldName());
if (file.exists() && !file.delete()) { if (file.exists() && !file.delete()) {
logger.error("[P2] persistent_regene_data file already exists and could not be deleted"); logger.error("persistent_regene_data file already exists and could not be deleted");
return; return;
} }
try (ObjectOutputStream oos = new ObjectOutputStream( try (ObjectOutputStream oos = new ObjectOutputStream(
Files.newOutputStream(file.toPath(), StandardOpenOption.CREATE_NEW))) { Files.newOutputStream(file.toPath(), StandardOpenOption.CREATE_NEW))) {
oos.writeObject(list); oos.writeObject(list);
} catch (IOException e) { } catch (IOException e) {
logger.error("[P2] Error creating persistent_region_data file", e); logger.error("Error creating persistent_region_data file", e);
} }
} }
@ -1237,7 +1237,7 @@ public class PlotSquared {
File file = FileUtils.getFile(platform.getDirectory(), Storage.SQLite.DB + ".db"); File file = FileUtils.getFile(platform.getDirectory(), Storage.SQLite.DB + ".db");
database = new SQLite(file); database = new SQLite(file);
} else { } else {
logger.error("[P2] No storage type is set. Disabling PlotSquared"); logger.error("No storage type is set. Disabling PlotSquared");
this.platform.shutdown(); //shutdown used instead of disable because no database is set this.platform.shutdown(); //shutdown used instead of disable because no database is set
return; return;
} }
@ -1255,11 +1255,11 @@ public class PlotSquared {
} }
this.clustersTmp = DBFunc.getClusters(); this.clustersTmp = DBFunc.getClusters();
} catch (ClassNotFoundException | SQLException e) { } catch (ClassNotFoundException | SQLException e) {
logger.error("[P2] Failed to open database connection ({}). Disabling PlotSquared", Storage.MySQL.USE ? "MySQL" : "SQLite"); logger.error("Failed to open database connection ({}). Disabling PlotSquared", Storage.MySQL.USE ? "MySQL" : "SQLite");
logger.error("[P2] ==== Here is an ugly stacktrace, if you are interested in those things ==="); logger.error("==== Here is an ugly stacktrace, if you are interested in those things ===");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] &d==== End of stacktrace ===="); logger.error("==== End of stacktrace ====");
logger.error("[P2] &6Please go to the {} 'storage.yml' and configure the database correctly", logger.error("Please go to the {} 'storage.yml' and configure the database correctly",
platform.getPluginName()); platform.getPluginName());
this.platform.shutdown(); //shutdown used instead of disable because of database error this.platform.shutdown(); //shutdown used instead of disable because of database error
} }
@ -1285,7 +1285,7 @@ public class PlotSquared {
try { try {
worldConfiguration.save(worldsFile); worldConfiguration.save(worldsFile);
} catch (IOException e) { } catch (IOException e) {
logger.error("[P2] Failed to save worlds.yml", e); logger.error("Failed to save worlds.yml", e);
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -1319,12 +1319,12 @@ public class PlotSquared {
public boolean setupConfigs() { public boolean setupConfigs() {
File folder = new File(this.platform.getDirectory(), "config"); File folder = new File(this.platform.getDirectory(), "config");
if (!folder.exists() && !folder.mkdirs()) { if (!folder.exists() && !folder.mkdirs()) {
logger.error("[P2] Failed to create the /plugins/config folder. Please create it manually"); logger.error("Failed to create the /plugins/PlotSquared/config folder. Please create it manually");
} }
try { try {
this.worldsFile = new File(folder, "worlds.yml"); this.worldsFile = new File(folder, "worlds.yml");
if (!this.worldsFile.exists() && !this.worldsFile.createNewFile()) { if (!this.worldsFile.exists() && !this.worldsFile.createNewFile()) {
logger.error("[P2] Could not create the worlds file. Please create 'worlds.yml' manually"); logger.error("Could not create the worlds file. Please create 'worlds.yml' manually");
} }
this.worldConfiguration = YamlConfiguration.loadConfiguration(this.worldsFile); this.worldConfiguration = YamlConfiguration.loadConfiguration(this.worldsFile);
@ -1334,20 +1334,20 @@ public class PlotSquared {
.equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worldConfiguration .equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worldConfiguration
.getString("configuration_version").equalsIgnoreCase("v5"))) { .getString("configuration_version").equalsIgnoreCase("v5"))) {
// Conversion needed // Conversion needed
logger.info("[P2] &aA legacy configuration file was detected. Conversion will be attempted."); logger.info("A legacy configuration file was detected. Conversion will be attempted.");
try { try {
com.google.common.io.Files com.google.common.io.Files
.copy(this.worldsFile, new File(folder, "worlds.yml.old")); .copy(this.worldsFile, new File(folder, "worlds.yml.old"));
logger.info("[P2] &6A copy of worlds.yml has been saved in the file worlds.yml.old"); logger.info("A copy of worlds.yml has been saved in the file worlds.yml.old");
final ConfigurationSection worlds = final ConfigurationSection worlds =
this.worldConfiguration.getConfigurationSection("worlds"); this.worldConfiguration.getConfigurationSection("worlds");
final LegacyConverter converter = new LegacyConverter(worlds); final LegacyConverter converter = new LegacyConverter(worlds);
converter.convert(); converter.convert();
this.worldConfiguration.set("worlds", worlds); this.worldConfiguration.set("worlds", worlds);
this.setConfigurationVersion(LegacyConverter.CONFIGURATION_VERSION); this.setConfigurationVersion(LegacyConverter.CONFIGURATION_VERSION);
logger.info("[P2] &aThe conversion has finished. PlotSquared will now be disabled and the new configuration file will be used at next startup. Please review the new worlds.yml file. Please note that schematics will not be converted, as we are now using WorldEdit to handle schematics. You need to re-generate the schematics."); logger.info("The conversion has finished. PlotSquared will now be disabled and the new configuration file will be used at next startup. Please review the new worlds.yml file. Please note that schematics will not be converted, as we are now using WorldEdit to handle schematics. You need to re-generate the schematics.");
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] &cFailed to convert the legacy configuration file. See stack trace for information.", e); logger.error("Failed to convert the legacy configuration file. See stack trace for information.", e);
} }
// Disable plugin // Disable plugin
this.platform.shutdown(); this.platform.shutdown();
@ -1357,27 +1357,27 @@ public class PlotSquared {
this.worldConfiguration.set("configuration_version", LegacyConverter.CONFIGURATION_VERSION); this.worldConfiguration.set("configuration_version", LegacyConverter.CONFIGURATION_VERSION);
} }
} catch (IOException ignored) { } catch (IOException ignored) {
logger.error("[P2] Failed to save worlds.yml"); logger.error("Failed to save worlds.yml");
} }
try { try {
this.configFile = new File(folder, "settings.yml"); this.configFile = new File(folder, "settings.yml");
if (!this.configFile.exists() && !this.configFile.createNewFile()) { if (!this.configFile.exists() && !this.configFile.createNewFile()) {
logger.error("[P2] Could not create the settings file. Please create 'settings.yml' manually"); logger.error("Could not create the settings file. Please create 'settings.yml' manually");
} }
this.config = YamlConfiguration.loadConfiguration(this.configFile); this.config = YamlConfiguration.loadConfiguration(this.configFile);
setupConfig(); setupConfig();
} catch (IOException ignored) { } catch (IOException ignored) {
logger.error("[P2] Failed to save settings.yml"); logger.error("Failed to save settings.yml");
} }
try { try {
this.storageFile = new File(folder, "storage.yml"); this.storageFile = new File(folder, "storage.yml");
if (!this.storageFile.exists() && !this.storageFile.createNewFile()) { if (!this.storageFile.exists() && !this.storageFile.createNewFile()) {
logger.error("[P2] Could not create the storage settings file. Please create 'storage.yml' manually"); logger.error("Could not create the storage settings file. Please create 'storage.yml' manually");
} }
YamlConfiguration.loadConfiguration(this.storageFile); YamlConfiguration.loadConfiguration(this.storageFile);
setupStorage(); setupStorage();
} catch (IOException ignored) { } catch (IOException ignored) {
logger.error("[P2] Failed to save storage.yml"); logger.error("Failed to save storage.yml");
} }
return true; return true;
} }
@ -1408,7 +1408,7 @@ public class PlotSquared {
if (Settings.DEBUG) { if (Settings.DEBUG) {
Map<String, Object> components = Settings.getFields(Settings.Enabled_Components.class); Map<String, Object> components = Settings.getFields(Settings.Enabled_Components.class);
for (Entry<String, Object> component : components.entrySet()) { for (Entry<String, Object> component : components.entrySet()) {
logger.info("[P2] Key: {} | Value: {}", component.getKey(), component.getValue()); logger.info("Key: {} | Value: {}", component.getKey(), component.getValue());
} }
} }
} }

View File

@ -175,7 +175,7 @@ public class Claim extends SubCommand {
try { try {
TaskManager.getPlatformImplementation().sync(() -> { TaskManager.getPlatformImplementation().sync(() -> {
if (!plot.claim(player, true, finalSchematic, false)) { if (!plot.claim(player, true, finalSchematic, false)) {
logger.info("[P2] Failed to claim plot {}", plot.getId().toCommaSeparatedString()); logger.info("Failed to claim plot {}", plot.getId().toCommaSeparatedString());
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed")); player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
plot.setOwnerAbs(null); plot.setOwnerAbs(null);
} else if (area.isAutoMerge()) { } else if (area.isAutoMerge()) {
@ -196,7 +196,7 @@ public class Claim extends SubCommand {
e.printStackTrace(); e.printStackTrace();
} }
}, () -> { }, () -> {
logger.info("[P2] Failed to add plot to database: {}", plot.getId().toCommaSeparatedString()); logger.info("Failed to add plot to database: {}", plot.getId().toCommaSeparatedString());
player.sendMessage(TranslatableCaption.of("working.plot_not_claimed")); player.sendMessage(TranslatableCaption.of("working.plot_not_claimed"));
plot.setOwnerAbs(null); plot.setOwnerAbs(null);
}); });

View File

@ -110,10 +110,10 @@ public class Debug extends SubCommand {
return true; return true;
} }
if (args.length > 0 && "logging".equalsIgnoreCase(args[0])) { if (args.length > 0 && "logging".equalsIgnoreCase(args[0])) {
logger.info("[P2] Info!"); logger.info("Info!");
logger.warn("[P2] Warning!"); logger.warn("Warning!");
logger.error("[P2] Error!", new RuntimeException()); logger.error("Error!", new RuntimeException());
logger.debug("[P2] Debug!"); logger.debug("Debug!");
return true; return true;
} }
if (args.length > 0 && "entitytypes".equalsIgnoreCase(args[0])) { if (args.length > 0 && "entitytypes".equalsIgnoreCase(args[0])) {

View File

@ -459,12 +459,12 @@ public class DebugExec extends SubCommand {
} catch (ScriptException e) { } catch (ScriptException e) {
e.printStackTrace(); e.printStackTrace();
} }
logger.info("[P2] {}ms -> {}", System.currentTimeMillis() - start, result); logger.info("{}ms -> {}", System.currentTimeMillis() - start, result);
}); });
} else { } else {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
Object result = this.engine.eval(script, this.scope); Object result = this.engine.eval(script, this.scope);
logger.info("[P2] {}ms -> {}", System.currentTimeMillis() - start, result); logger.info("{}ms -> {}", System.currentTimeMillis() - start, result);
} }
return true; return true;
} catch (ScriptException e) { } catch (ScriptException e) {

View File

@ -201,7 +201,7 @@ public class Purge extends SubCommand {
boolean finalClear = clear; boolean finalClear = clear;
Runnable run = () -> { Runnable run = () -> {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Calculating plots to purge, please wait..."); logger.info("Calculating plots to purge, please wait...");
} }
HashSet<Integer> ids = new HashSet<>(); HashSet<Integer> ids = new HashSet<>();
Iterator<Plot> iterator = toDelete.iterator(); Iterator<Plot> iterator = toDelete.iterator();
@ -217,7 +217,7 @@ public class Purge extends SubCommand {
if (finalClear) { if (finalClear) {
plot.clear(false, true, () -> { plot.clear(false, true, () -> {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Plot {} cleared by purge", plot.getId()); logger.info("Plot {} cleared by purge", plot.getId());
} }
}); });
} else { } else {
@ -228,7 +228,7 @@ public class Purge extends SubCommand {
Purge.this.plotListener.plotEntry(pp, plot); Purge.this.plotListener.plotEntry(pp, plot);
} }
} catch (NullPointerException e) { } catch (NullPointerException e) {
logger.error("[P2] NullPointer during purge detected. This is likely" logger.error("NullPointer during purge detected. This is likely"
+ " because you are deleting a world that has been removed", e); + " because you are deleting a world that has been removed", e);
} }
} }

View File

@ -145,15 +145,15 @@ public class Trim extends SubCommand {
@Override public void run(Set<BlockVector2> viable, final Set<BlockVector2> nonViable) { @Override public void run(Set<BlockVector2> viable, final Set<BlockVector2> nonViable) {
Runnable regenTask; Runnable regenTask;
if (regen) { if (regen) {
logger.info("[P2] Starting regen task"); logger.info("Starting regen task");
logger.info("[P2] - This is a VERY slow command"); logger.info(" - This is a VERY slow command");
logger.info("[P2] - It will say 'Trim done!' when complete"); logger.info(" - It will say 'Trim done!' when complete");
regenTask = new Runnable() { regenTask = new Runnable() {
@Override public void run() { @Override public void run() {
if (nonViable.isEmpty()) { if (nonViable.isEmpty()) {
Trim.TASK = false; Trim.TASK = false;
player.sendMessage(TranslatableCaption.of("trim.trim_done")); player.sendMessage(TranslatableCaption.of("trim.trim_done"));
logger.info("[P2] Trim done!"); logger.info("Trim done!");
return; return;
} }
Iterator<BlockVector2> iterator = nonViable.iterator(); Iterator<BlockVector2> iterator = nonViable.iterator();
@ -203,7 +203,7 @@ public class Trim extends SubCommand {
regenTask = () -> { regenTask = () -> {
Trim.TASK = false; Trim.TASK = false;
player.sendMessage(TranslatableCaption.of("trim.trim_done")); player.sendMessage(TranslatableCaption.of("trim.trim_done"));
logger.info("[P2] Trim done!"); logger.info("Trim done!");
}; };
} }
regionManager.deleteRegionFiles(world, viable, regenTask); regionManager.deleteRegionFiles(world, viable, regenTask);

View File

@ -83,7 +83,7 @@ public class ComponentPresetManager {
e.printStackTrace(); e.printStackTrace();
} }
if (!created) { if (!created) {
logger.error("[P2] Failed to create components.yml"); logger.error("Failed to create components.yml");
this.guiName = "&cInvalid!"; this.guiName = "&cInvalid!";
this.presets = new ArrayList<>(); this.presets = new ArrayList<>();
return; return;
@ -99,7 +99,7 @@ public class ComponentPresetManager {
try { try {
yamlConfiguration.save(file); yamlConfiguration.save(file);
} catch (IOException e) { } catch (IOException e) {
logger.error("[P2] Failed to save default values to components.yml", e); logger.error("Failed to save default values to components.yml", e);
} }
} }
this.guiName = yamlConfiguration.getString("title", "&6Plot Components"); this.guiName = yamlConfiguration.getString("title", "&6Plot Components");
@ -115,7 +115,7 @@ public class ComponentPresetManager {
try { try {
yamlConfiguration.save(file); yamlConfiguration.save(file);
} catch (final IOException e) { } catch (final IOException e) {
logger.error("[P2] Failed to save default values to components.yml", e); logger.error("Failed to save default values to components.yml", e);
} }
this.presets = defaultPreset; this.presets = defaultPreset;
} }

View File

@ -98,12 +98,12 @@ public class Config {
field.set(instance, value); field.set(instance, value);
return; return;
} catch (final Throwable e) { } catch (final Throwable e) {
logger.error("[P2] Invalid configuration value '{}: {}' in {}", key, value, root.getSimpleName()); logger.error("Invalid configuration value '{}: {}' in {}", key, value, root.getSimpleName());
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
logger.error("[P2] Failed to set config option '{}: {}' | {}", key, value, instance); logger.error("Failed to set config option '{}: {}' | {}", key, value, instance);
} }
public static boolean load(File file, Class<? extends Config> root) { public static boolean load(File file, Class<? extends Config> root) {
@ -289,7 +289,7 @@ public class Config {
setAccessible(field); setAccessible(field);
return field; return field;
} catch (final Throwable e) { } catch (final Throwable e) {
logger.error("[P2] Invalid config field: {} for {}", logger.error("Invalid config field: {} for {}",
StringMan.join(split, "."), toNodeName(instance.getClass().getSimpleName())); StringMan.join(split, "."), toNodeName(instance.getClass().getSimpleName()));
e.printStackTrace(); e.printStackTrace();
return null; return null;

View File

@ -82,11 +82,11 @@ public class YamlConfiguration extends FileConfiguration {
} }
Files.copy(file.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING); Files.copy(file.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.error("[P2] Could not read: {}", file); logger.error("Could not read: {}", file);
logger.error("[P2] Renamed to: {}", file); logger.error("Renamed to: {}", file);
logger.error("[P2] ============ Full stacktrace ============"); logger.error("============ Full stacktrace ============");
ex.printStackTrace(); ex.printStackTrace();
logger.error("[P2] ========================================="); logger.error("=========================================");
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -373,12 +373,12 @@ public class SQLManager implements AbstractDB {
try { try {
task.run(); task.run();
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] There was an error updating the database."); logger.error("There was an error updating the database.");
logger.error("[P2] - It will be corrected on shutdown"); logger.error(" - It will be corrected on shutdown");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] ========================================"); logger.error("========================================");
} }
} }
commit(); commit();
@ -428,12 +428,12 @@ public class SQLManager implements AbstractDB {
} }
lastTask = task; lastTask = task;
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] There was an error updating the database."); logger.error("There was an error updating the database.");
logger.error("[P2] - It will be corrected on shutdown"); logger.error(" - It will be corrected on shutdown");
logger.error("[P2] ========================================"); logger.error("========================================");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] ========================================"); logger.error("========================================");
} }
} }
if (statement != null && task != null) { if (statement != null && task != null) {
@ -473,12 +473,12 @@ public class SQLManager implements AbstractDB {
} }
lastTask = task; lastTask = task;
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] There was an error updating the database."); logger.error("There was an error updating the database.");
logger.error("[P2] - It will be corrected on shutdown"); logger.error(" - It will be corrected on shutdown");
logger.error("[P2] ========================================"); logger.error("========================================");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] ========================================"); logger.error("========================================");
} }
} }
if (statement != null && task != null) { if (statement != null && task != null) {
@ -519,12 +519,12 @@ public class SQLManager implements AbstractDB {
} }
lastTask = task; lastTask = task;
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] There was an error updating the database."); logger.error("There was an error updating the database.");
logger.error("[P2] - It will be corrected on shutdown"); logger.error(" - It will be corrected on shutdown");
logger.error("[P2] ========================================"); logger.error("========================================");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] ========================================"); logger.error("========================================");
} }
} }
if (statement != null && task != null) { if (statement != null && task != null) {
@ -548,12 +548,12 @@ public class SQLManager implements AbstractDB {
this.plotTasks.clear(); this.plotTasks.clear();
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] ============ DATABASE ERROR ============"); logger.error("============ DATABASE ERROR ============");
logger.error("[P2] There was an error updating the database."); logger.error("There was an error updating the database.");
logger.error("[P2] - It will be corrected on shutdown"); logger.error(" - It will be corrected on shutdown");
logger.error("[P2] ========================================"); logger.error("========================================");
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] ========================================"); logger.error("========================================");
} }
return false; return false;
} }
@ -641,7 +641,7 @@ public class SQLManager implements AbstractDB {
} }
}))))); })))));
} catch (SQLException e) { } catch (SQLException e) {
logger.warn("[P2] Failed to set all flags and member tiers for plots", e); logger.warn("Failed to set all flags and member tiers for plots", e);
try { try {
SQLManager.this.connection.commit(); SQLManager.this.connection.commit();
} catch (SQLException e1) { } catch (SQLException e1) {
@ -650,7 +650,7 @@ public class SQLManager implements AbstractDB {
} }
}); });
} catch (Exception e) { } catch (Exception e) {
logger.warn("[P2] Warning! Failed to set all helper for plots", e); logger.warn("Warning! Failed to set all helper for plots", e);
try { try {
SQLManager.this.connection.commit(); SQLManager.this.connection.commit();
} catch (SQLException e1) { } catch (SQLException e1) {
@ -719,19 +719,19 @@ public class SQLManager implements AbstractDB {
try { try {
preparedStatement.executeBatch(); preparedStatement.executeBatch();
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store flag values for plot with entry ID: {}", plot); logger.error("Failed to store flag values for plot with entry ID: {}", plot);
e.printStackTrace(); e.printStackTrace();
continue; continue;
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Finished converting flag values for plot with entry ID: {}", logger.info("- Finished converting flag values for plot with entry ID: {}",
plot.getId()); plot.getId());
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store flag values", e); logger.error("Failed to store flag values", e);
} }
logger.info("[P2] Finished converting flags ({} plots processed)", plots.size()); logger.info("Finished converting flags ({} plots processed)", plots.size());
whenDone.run(); whenDone.run();
} }
@ -848,7 +848,7 @@ public class SQLManager implements AbstractDB {
return; return;
} catch (SQLException e) { } catch (SQLException e) {
if (this.mySQL) { if (this.mySQL) {
logger.error("[P2] 1: | {}", objList.get(0).getClass().getCanonicalName()); logger.error("1: | {}", objList.get(0).getClass().getCanonicalName());
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -886,8 +886,8 @@ public class SQLManager implements AbstractDB {
preparedStmt.close(); preparedStmt.close();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] 2: | {}", objList.get(0).getClass().getCanonicalName()); logger.error("2: | {}", objList.get(0).getClass().getCanonicalName());
logger.error("[P2] Could not bulk save!"); logger.error("Could not bulk save!");
try (PreparedStatement preparedStmt = this.connection try (PreparedStatement preparedStmt = this.connection
.prepareStatement(mod.getCreateSQL())) { .prepareStatement(mod.getCreateSQL())) {
for (T obj : objList) { for (T obj : objList) {
@ -896,7 +896,7 @@ public class SQLManager implements AbstractDB {
} }
preparedStmt.executeBatch(); preparedStmt.executeBatch();
} catch (SQLException e3) { } catch (SQLException e3) {
logger.error("[P2] Failed to save all", e); logger.error("Failed to save all", e);
e3.printStackTrace(); e3.printStackTrace();
} }
} }
@ -948,7 +948,7 @@ public class SQLManager implements AbstractDB {
try { try {
preparedStatement.executeBatch(); preparedStatement.executeBatch();
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store settings for plot with entry ID: {}", legacySettings.id); logger.error("Failed to store settings for plot with entry ID: {}", legacySettings.id);
e.printStackTrace(); e.printStackTrace();
continue; continue;
} }
@ -960,13 +960,13 @@ public class SQLManager implements AbstractDB {
try { try {
preparedStatement.executeBatch(); preparedStatement.executeBatch();
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store settings", e); logger.error("Failed to store settings", e);
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store settings", e); logger.error("Failed to store settings", e);
} }
logger.info("[P2] Finished converting settihgs ({} plots processed)", myList.size()); logger.info("Finished converting settings ({} plots processed)", myList.size());
whenDone.run(); whenDone.run();
} }
@ -1647,11 +1647,11 @@ public class SQLManager implements AbstractDB {
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to load old flag values", e); logger.error("Failed to load old flag values", e);
return false; return false;
} }
logger.info("[P2] Loaded {} plot flag collections...", flagMap.size()); logger.info("Loaded {} plot flag collections...", flagMap.size());
logger.info("[P2] Attempting to store these flags in the new table..."); logger.info("Attempting to store these flags in the new table...");
try (final PreparedStatement preparedStatement = this.connection.prepareStatement( try (final PreparedStatement preparedStatement = this.connection.prepareStatement(
"INSERT INTO `" + SQLManager.this.prefix "INSERT INTO `" + SQLManager.this.prefix
+ "plot_flags`(`plot_id`, `flag`, `value`) VALUES(?, ?, ?)")) { + "plot_flags`(`plot_id`, `flag`, `value`) VALUES(?, ?, ?)")) {
@ -1679,7 +1679,7 @@ public class SQLManager implements AbstractDB {
try { try {
preparedStatement.executeBatch(); preparedStatement.executeBatch();
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store flag values for plot with entry ID: {}", plotFlagEntry.getKey()); logger.error("Failed to store flag values for plot with entry ID: {}", plotFlagEntry.getKey());
e.printStackTrace(); e.printStackTrace();
continue; continue;
} }
@ -1687,17 +1687,17 @@ public class SQLManager implements AbstractDB {
if (System.currentTimeMillis() - timeStarted >= 1000L || plotsProcessed >= flagMap if (System.currentTimeMillis() - timeStarted >= 1000L || plotsProcessed >= flagMap
.size()) { .size()) {
timeStarted = System.currentTimeMillis(); timeStarted = System.currentTimeMillis();
logger.info("[P2] ... Flag conversion in progress. {}% done", logger.info("... Flag conversion in progress. {}% done",
String.format("%.1f", ((float) flagsProcessed / totalFlags) * 100)); String.format("%.1f", ((float) flagsProcessed / totalFlags) * 100));
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Finished converting flags for plot with entry ID: {}", logger.info("- Finished converting flags for plot with entry ID: {}",
plotFlagEntry.getKey()); plotFlagEntry.getKey());
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to store flag values", e); logger.error("Failed to store flag values", e);
return false; return false;
} }
return true; return true;
@ -1788,7 +1788,7 @@ public class SQLManager implements AbstractDB {
time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(parsable) time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(parsable)
.getTime(); .getTime();
} catch (ParseException e) { } catch (ParseException e) {
logger.error("[P2] Could not parse date for plot: #{}({};{}) ({})", logger.error("Could not parse date for plot: #{}({};{}) ({})",
id, areaID, plot_id, parsable); id, areaID, plot_id, parsable);
time = System.currentTimeMillis() + id; time = System.currentTimeMillis() + id;
} }
@ -1803,7 +1803,7 @@ public class SQLManager implements AbstractDB {
if (Settings.Enabled_Components.DATABASE_PURGER) { if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(last.temp); toDelete.add(last.temp);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Plot #{}({}) in `{}plot` is a duplicate." logger.info("Plot #{}({}) in `{}plot` is a duplicate."
+ " Delete this plot or set `database-purger: true` in the settings.yml", id, last, this.prefix); + " Delete this plot or set `database-purger: true` in the settings.yml", id, last, this.prefix);
} }
} }
@ -1835,7 +1835,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_rating` does not exist." logger.info("Entry #{}({}) in `plot_rating` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -1863,7 +1863,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_helpers` does not exist." logger.info("Entry #{}({}) in `plot_helpers` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -1890,7 +1890,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_trusted` does not exist." logger.info("Entry #{}({}) in `plot_trusted` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -1917,7 +1917,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_denied` does not exist." logger.info("Entry #{}({}) in `plot_denied` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -1945,8 +1945,8 @@ public class SQLManager implements AbstractDB {
plot.getFlagContainer().addFlag(plotFlag.parse(value)); plot.getFlagContainer().addFlag(plotFlag.parse(value));
} catch (final FlagParseException e) { } catch (final FlagParseException e) {
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] Plot with ID {} has an invalid value:", id); logger.error("Plot with ID {} has an invalid value:", id);
logger.error("[P2] Failed to parse flag '{}', value '{}': {}", logger.error("Failed to parse flag '{}', value '{}': {}",
plotFlag.getName(), e.getValue(), e.getErrorMessage()); plotFlag.getName(), e.getValue(), e.getErrorMessage());
if (!invalidFlags.containsKey(plot)) { if (!invalidFlags.containsKey(plot)) {
invalidFlags.put(plot, new ArrayList<>()); invalidFlags.put(plot, new ArrayList<>());
@ -1957,7 +1957,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_flags` does not exist." logger.info("Entry #{}({}) in `plot_flags` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -2013,7 +2013,7 @@ public class SQLManager implements AbstractDB {
} else if (Settings.Enabled_Components.DATABASE_PURGER) { } else if (Settings.Enabled_Components.DATABASE_PURGER) {
toDelete.add(id); toDelete.add(id);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] Entry #{}({}) in `plot_settings` does not exist." logger.info("Entry #{}({}) in `plot_settings` does not exist."
+ " Create this plot or set `database-purger: true` in settings.yml", id, plot); + " Create this plot or set `database-purger: true` in settings.yml", id, plot);
} }
} }
@ -2031,15 +2031,15 @@ public class SQLManager implements AbstractDB {
String worldName = entry.getKey(); String worldName = entry.getKey();
invalidPlot = true; invalidPlot = true;
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Warning! Found {} plots in DB for non existent world: '{}'", logger.info("Warning! Found {} plots in DB for non existent world: '{}'",
entry.getValue().intValue(), worldName); entry.getValue().intValue(), worldName);
} }
} }
if (invalidPlot && Settings.DEBUG) { if (invalidPlot && Settings.DEBUG) {
logger.info("[P2] Warning! Please create the world(s) or remove the plots using the purge command"); logger.info("Warning! Please create the world(s) or remove the plots using the purge command");
} }
} catch (SQLException e) { } catch (SQLException e) {
logger.error("[P2] Failed to load plots", e); logger.error("Failed to load plots", e);
} }
return newPlots; return newPlots;
} }
@ -2080,7 +2080,7 @@ public class SQLManager implements AbstractDB {
preparedStatement.setInt(3, id2); preparedStatement.setInt(3, id2);
preparedStatement.execute(); preparedStatement.execute();
} catch (final Exception e) { } catch (final Exception e) {
logger.error("[P2] Failed to persist wap of {} and {}", plot1, plot2); logger.error("Failed to persist wap of {} and {}", plot1, plot2);
e.printStackTrace(); e.printStackTrace();
future.complete(false); future.complete(false);
return; return;
@ -2223,12 +2223,12 @@ public class SQLManager implements AbstractDB {
commit(); commit();
} }
} catch (SQLException e) { } catch (SQLException e) {
logger.error("[P2] Failed to purge plots", e); logger.error("Failed to purge plots", e);
return; return;
} }
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Successfully purged {} plots", uniqueIds.size()); logger.info("Successfully purged {} plots", uniqueIds.size());
} }
} }
}); });
@ -2252,7 +2252,7 @@ public class SQLManager implements AbstractDB {
} }
purgeIds(ids); purgeIds(ids);
} catch (SQLException e) { } catch (SQLException e) {
logger.error("[P2] Failed to purge area '{}'", area); logger.error("Failed to purge area '{}'", area);
e.printStackTrace(); e.printStackTrace();
} }
for (Iterator<PlotId> iterator = plots.iterator(); iterator.hasNext(); ) { for (Iterator<PlotId> iterator = plots.iterator(); iterator.hasNext(); ) {
@ -2509,7 +2509,7 @@ public class SQLManager implements AbstractDB {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
logger.error("[P2] Failed to fetch rating for plot {}", plot.getId().toString()); logger.error("Failed to fetch rating for plot {}", plot.getId().toString());
e.printStackTrace(); e.printStackTrace();
} }
return map; return map;
@ -2729,7 +2729,7 @@ public class SQLManager implements AbstractDB {
if (cluster != null) { if (cluster != null) {
cluster.helpers.add(user); cluster.helpers.add(user);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.warn("[P2] Cluster #{}({}) in cluster_helpers does not exist." logger.warn("Cluster #{}({}) in cluster_helpers does not exist."
+ " Please create the cluster or remove this entry", id, cluster); + " Please create the cluster or remove this entry", id, cluster);
} }
} }
@ -2748,7 +2748,7 @@ public class SQLManager implements AbstractDB {
if (cluster != null) { if (cluster != null) {
cluster.invited.add(user); cluster.invited.add(user);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.warn("[P2] Cluster #{}({}) in cluster_helpers does not exist." logger.warn("Cluster #{}({}) in cluster_helpers does not exist."
+ " Please create the cluster or remove this entry", id, cluster); + " Please create the cluster or remove this entry", id, cluster);
} }
} }
@ -2783,7 +2783,7 @@ public class SQLManager implements AbstractDB {
} }
cluster.settings.setMerged(merged); cluster.settings.setMerged(merged);
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.warn("[P2] Cluster #{}({}) in cluster_helpers does not exist." logger.warn("Cluster #{}({}) in cluster_helpers does not exist."
+ " Please create the cluster or remove this entry", id, cluster); + " Please create the cluster or remove this entry", id, cluster);
} }
} }
@ -2793,13 +2793,13 @@ public class SQLManager implements AbstractDB {
for (Entry<String, Integer> entry : noExist.entrySet()) { for (Entry<String, Integer> entry : noExist.entrySet()) {
String a = entry.getKey(); String a = entry.getKey();
invalidPlot = true; invalidPlot = true;
logger.warn("[P2] Warning! Found {} clusters in DB for non existent area; '{}'", noExist.get(a), a); logger.warn("Warning! Found {} clusters in DB for non existent area; '{}'", noExist.get(a), a);
} }
if (invalidPlot) { if (invalidPlot) {
logger.warn("[P2] Warning! Please create the world(s) or remove the clusters using the purge command"); logger.warn("Warning! Please create the world(s) or remove the clusters using the purge command");
} }
} catch (SQLException e) { } catch (SQLException e) {
logger.error("[P2] Failed to load clusters", e); logger.error("Failed to load clusters", e);
} }
return newClusters; return newClusters;
} }
@ -2991,7 +2991,7 @@ public class SQLManager implements AbstractDB {
if (!isValid()) { if (!isValid()) {
reconnect(); reconnect();
} }
logger.info("[P2] All DB transactions during this session are being validated (This may take a while if corrections need to be made)"); logger.info("All DB transactions during this session are being validated (This may take a while if corrections need to be made)");
commit(); commit();
while (true) { while (true) {
if (!sendBatch()) { if (!sendBatch()) {
@ -3012,13 +3012,13 @@ public class SQLManager implements AbstractDB {
continue; continue;
} }
if (plot.getArea() == null) { if (plot.getArea() == null) {
logger.error("[P2] CRITICAL ERROR IN VALIDATION TASK!"); logger.error("CRITICAL ERROR IN VALIDATION TASK!");
logger.error("[P2] PLOT AREA CANNOT BE NULL! SKIPPING PLOT!"); logger.error("PLOT AREA CANNOT BE NULL! SKIPPING PLOT!");
continue; continue;
} }
if (database == null) { if (database == null) {
logger.error("[P2] CRITICAL ERROR IN VALIDATION TASK!"); logger.error("CRITICAL ERROR IN VALIDATION TASK!");
logger.error("[P2] DATABASE VARIABLE CANNOT BE NULL! NOW ENDING VALIDATION!"); logger.error("DATABASE VARIABLE CANNOT BE NULL! NOW ENDING VALIDATION!");
break; break;
} }
HashMap<PlotId, Plot> worldPlots = database.get(plot.getArea().toString()); HashMap<PlotId, Plot> worldPlots = database.get(plot.getArea().toString());

View File

@ -68,7 +68,7 @@ public class SQLite extends Database {
try { try {
file.createNewFile(); file.createNewFile();
} catch (IOException ignored) { } catch (IOException ignored) {
logger.error("[P2] Unable to create database"); logger.error("Unable to create database");
} }
} }
Class.forName("org.sqlite.JDBC"); Class.forName("org.sqlite.JDBC");

View File

@ -177,7 +177,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
// Dump world settings // Dump world settings
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Dumping settings for ClassicPlotWorld with name {}", this.getWorldName()); logger.info("- Dumping settings for ClassicPlotWorld with name {}", this.getWorldName());
final Field[] fields = this.getClass().getFields(); final Field[] fields = this.getClass().getFields();
for (final Field field : fields) { for (final Field field : fields) {
final String name = field.getName().toLowerCase(Locale.ENGLISH); final String name = field.getName().toLowerCase(Locale.ENGLISH);
@ -193,7 +193,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
} catch (final IllegalAccessException e) { } catch (final IllegalAccessException e) {
value = String.format("Failed to parse: %s", e.getMessage()); value = String.format("Failed to parse: %s", e.getMessage());
} }
logger.info("[P2] -- {} = {}", name, value); logger.info("-- {} = {}", name, value);
} }
} }
} }
@ -294,12 +294,12 @@ public class HybridPlotWorld extends ClassicPlotWorld {
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - plot schematic: {}", schematic3File.getPath()); logger.info(" - plot schematic: {}", schematic3File.getPath());
} }
} }
if (schematic1 == null || schematic2 == null || this.ROAD_WIDTH == 0) { if (schematic1 == null || schematic2 == null || this.ROAD_WIDTH == 0) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - schematic: false"); logger.info(" - schematic: false");
} }
return; return;
} }
@ -367,7 +367,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
int pair = MathMan.pair(x, z); int pair = MathMan.pair(x, z);
BaseBlock[] existing = this.G_SCH.computeIfAbsent(pair, k -> new BaseBlock[height]); BaseBlock[] existing = this.G_SCH.computeIfAbsent(pair, k -> new BaseBlock[height]);
if (y >= height) { if (y >= height) {
logger.error("[P2] Error adding overlay block. `y > height`"); logger.error("Error adding overlay block. `y > height`");
return; return;
} }
existing[y] = id; existing[y] = id;

View File

@ -421,23 +421,23 @@ public class HybridUtils {
iter.remove(); iter.remove();
boolean regenedRoad = regenerateRoad(area, chunk, extend); boolean regenedRoad = regenerateRoad(area, chunk, extend);
if (!regenedRoad && Settings.DEBUG) { if (!regenedRoad && Settings.DEBUG) {
logger.info("[P2] Failed to regenerate roads"); logger.info("Failed to regenerate roads");
} }
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Cancelled road task"); logger.info("Cancelled road task");
} }
return; return;
} }
count.incrementAndGet(); count.incrementAndGet();
if (count.intValue() % 20 == 0) { if (count.intValue() % 20 == 0) {
logger.info("[P2] Progress: {}%", 100 * (2048 - chunks.size()) / 2048); logger.info("Progress: {}%", 100 * (2048 - chunks.size()) / 2048);
} }
if (HybridUtils.regions.isEmpty() && chunks.isEmpty()) { if (HybridUtils.regions.isEmpty() && chunks.isEmpty()) {
regeneratePlotWalls(area); regeneratePlotWalls(area);
HybridUtils.UPDATE = false; HybridUtils.UPDATE = false;
logger.info("[P2] Finished road conversion"); logger.info("Finished road conversion");
// CANCEL TASK // CANCEL TASK
} else { } else {
final Runnable task = this; final Runnable task = this;
@ -449,8 +449,8 @@ public class HybridUtils {
BlockVector2 loc = iterator.next(); BlockVector2 loc = iterator.next();
iterator.remove(); iterator.remove();
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Updating .mcr: {}, {} (approx 1024 chunks)", loc.getX(), loc.getZ()); logger.info("Updating .mcr: {}, {} (approx 1024 chunks)", loc.getX(), loc.getZ());
logger.info("[P2] - Remaining: {}", HybridUtils.regions.size()); logger.info("- Remaining: {}", HybridUtils.regions.size());
} }
chunks.addAll(getChunks(loc)); chunks.addAll(getChunks(loc));
System.gc(); System.gc();
@ -465,7 +465,7 @@ public class HybridUtils {
iterator.remove(); iterator.remove();
boolean regenedRoads = regenerateRoad(area, chunk, extend); boolean regenedRoads = regenerateRoad(area, chunk, extend);
if (!regenedRoads && Settings.DEBUG) { if (!regenedRoads && Settings.DEBUG) {
logger.info("[P2] Failed to regenerate road"); logger.info("Failed to regenerate road");
} }
} }
return null; return null;
@ -476,7 +476,7 @@ public class HybridUtils {
Iterator<BlockVector2> iterator = HybridUtils.regions.iterator(); Iterator<BlockVector2> iterator = HybridUtils.regions.iterator();
BlockVector2 loc = iterator.next(); BlockVector2 loc = iterator.next();
iterator.remove(); iterator.remove();
logger.error("[P2] Error! Could not update '{}/region/r.{}.{}.mca' (Corrupt chunk?)", area.getWorldHash(), loc.getX(), logger.error("Error! Could not update '{}/region/r.{}.{}.mca' (Corrupt chunk?)", area.getWorldHash(), loc.getX(),
loc.getZ()); loc.getZ());
} }
TaskManager.runTaskLater(task, TaskTime.seconds(1L)); TaskManager.runTaskLater(task, TaskTime.seconds(1L));

View File

@ -61,7 +61,7 @@ public abstract class SquarePlotWorld extends GridPlotWorld {
@Override public void loadConfiguration(ConfigurationSection config) { @Override public void loadConfiguration(ConfigurationSection config) {
if (!config.contains("plot.height")) { if (!config.contains("plot.height")) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Configuration is null? ({})", config.getCurrentPath()); logger.info(" - Configuration is null? ({})", config.getCurrentPath());
} }
} }

View File

@ -590,7 +590,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
for (Plot owned : getPlots()) { for (Plot owned : getPlots()) {
owned.deletePlot(null); owned.deletePlot(null);
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Plot {} was deleted + cleared due to {} getting banned", owned.getId(), getName()); logger.info("Plot {} was deleted + cleared due to {} getting banned", owned.getId(), getName());
} }
} }
} }

View File

@ -327,7 +327,7 @@ public class Plot {
if (arg == null) { if (arg == null) {
if (player == null) { if (player == null) {
if (message) { if (message) {
logger.info("[P2] No plot area string was supplied"); logger.info("No plot area string was supplied");
} }
return null; return null;
} }
@ -1093,7 +1093,7 @@ public class Plot {
try { try {
regionManager.regenerateRegion(current.getBottomAbs(), current.getTopAbs(), false, this); regionManager.regenerateRegion(current.getBottomAbs(), current.getTopAbs(), false, this);
} catch (UnsupportedOperationException exception) { } catch (UnsupportedOperationException exception) {
logger.info("[P2] Please ask md_5 to fix regenerateChunk() because it breaks plugins. We apologize for the inconvenience."); logger.info("Please ask md_5 to fix regenerateChunk() because it breaks plugins. We apologize for the inconvenience.");
return; return;
} }
return; return;
@ -1859,7 +1859,7 @@ public class Plot {
if (updateDB) { if (updateDB) {
if (!create(player.getUUID(), true)) { if (!create(player.getUUID(), true)) {
logger.error("[P2] Player {} attempted to claim plot {}, but the database failed to update", player.getName(), logger.error("Player {} attempted to claim plot {}, but the database failed to update", player.getName(),
this.getId().toCommaSeparatedString()); this.getId().toCommaSeparatedString());
return false; return false;
} }
@ -1952,7 +1952,7 @@ public class Plot {
}); });
return true; return true;
} }
logger.info("[P2] Failed to add plot {} to plot area {}", this.getId().toCommaSeparatedString(), this.area.toString()); logger.info("Failed to add plot {} to plot area {}", this.getId().toCommaSeparatedString(), this.area.toString());
return false; return false;
} }

View File

@ -1145,7 +1145,7 @@ public abstract class PlotArea {
try { try {
flags.add(flagInstance.parse(split[1])); flags.add(flagInstance.parse(split[1]));
} catch (final FlagParseException e) { } catch (final FlagParseException e) {
logger.warn("[P2] Failed to parse default flag with key '{}' and value '{}'. " logger.warn("Failed to parse default flag with key '{}' and value '{}'. "
+ "Reason: {}. This flag will not be added as a default flag.", + "Reason: {}. This flag will not be added as a default flag.",
e.getFlag().getName(), e.getFlag().getName(),
e.getValue(), e.getValue(),

View File

@ -98,7 +98,7 @@ public class PlotAnalysis {
public static void calcOptimalModifiers(final Runnable whenDone, final double threshold) { public static void calcOptimalModifiers(final Runnable whenDone, final double threshold) {
if (running) { if (running) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Calibration task already in progress!"); logger.info("Calibration task already in progress!");
} }
return; return;
} }
@ -115,7 +115,7 @@ public class PlotAnalysis {
@Override public void run() { @Override public void run() {
Iterator<Plot> iterator = plots.iterator(); Iterator<Plot> iterator = plots.iterator();
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Reducing {} plots to those with sufficient data", plots.size()); logger.info("- Reducing {} plots to those with sufficient data", plots.size());
} }
while (iterator.hasNext()) { while (iterator.hasNext()) {
Plot plot = iterator.next(); Plot plot = iterator.next();
@ -140,7 +140,7 @@ public class PlotAnalysis {
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Analyzing plot contents (this may take a while)"); logger.info("- Analyzing plot contents (this may take a while)");
} }
int[] changes = new int[plots.size()]; int[] changes = new int[plots.size()];
@ -168,7 +168,7 @@ public class PlotAnalysis {
(plot.getAverageRating() + plot.getSettings().getRatings().size()) (plot.getAverageRating() + plot.getSettings().getRatings().size())
* 100); * 100);
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] | {} (rating) {}", plot, ratings[i]); logger.info(" | {} (rating) {}", plot, ratings[i]);
} }
} }
} }
@ -182,7 +182,7 @@ public class PlotAnalysis {
break; break;
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] | {}", queuePlot); logger.info(" | {}", queuePlot);
} }
final Object lock = new Object(); final Object lock = new Object();
TaskManager.runTask(new Runnable() { TaskManager.runTask(new Runnable() {
@ -214,7 +214,7 @@ public class PlotAnalysis {
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Waiting on plot rating thread: {}%", mi.intValue() * 100 / plots.size()); logger.info(" - Waiting on plot rating thread: {}%", mi.intValue() * 100 / plots.size());
} }
try { try {
@ -230,7 +230,7 @@ public class PlotAnalysis {
for (int i = 0; i < plots.size(); i++) { for (int i = 0; i < plots.size(); i++) {
Plot plot = plots.get(i); Plot plot = plots.get(i);
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] | {}", plot); logger.info(" | {}", plot);
} }
PlotAnalysis analysis = plot.getComplexity(null); PlotAnalysis analysis = plot.getComplexity(null);
@ -248,7 +248,7 @@ public class PlotAnalysis {
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Calculating rankings"); logger.info(" - Calculating rankings");
} }
int[] rankRatings = rank(ratings); int[] rankRatings = rank(ratings);
@ -257,7 +257,7 @@ public class PlotAnalysis {
int optimalIndex = (int) Math.round((1 - threshold) * (n - 1)); int optimalIndex = (int) Math.round((1 - threshold) * (n - 1));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Calculating rank correlation: "); logger.info(" - Calculating rank correlation: ");
logger.info( logger.info(
" - The analyzed plots which were processed and put into bulk data will be compared and correlated to the plot ranking"); " - The analyzed plots which were processed and put into bulk data will be compared and correlated to the plot ranking");
logger.info( logger.info(
@ -276,7 +276,7 @@ public class PlotAnalysis {
(int) (factorChanges * 1000 / MathMan.getMean(changes)); (int) (factorChanges * 1000 / MathMan.getMean(changes));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | changes {}", factorChanges); logger.info(" - | changes {}", factorChanges);
} }
int[] rankFaces = rank(faces); int[] rankFaces = rank(faces);
@ -288,7 +288,7 @@ public class PlotAnalysis {
factorFaces == 1 ? 0 : (int) (factorFaces * 1000 / MathMan.getMean(faces)); factorFaces == 1 ? 0 : (int) (factorFaces * 1000 / MathMan.getMean(faces));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | faces {}", factorFaces); logger.info(" - | faces {}", factorFaces);
} }
int[] rankData = rank(data); int[] rankData = rank(data);
@ -300,7 +300,7 @@ public class PlotAnalysis {
factor_data == 1 ? 0 : (int) (factor_data * 1000 / MathMan.getMean(data)); factor_data == 1 ? 0 : (int) (factor_data * 1000 / MathMan.getMean(data));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | data {}", factor_data); logger.info(" - | data {}", factor_data);
} }
int[] rank_air = rank(air); int[] rank_air = rank(air);
@ -312,7 +312,7 @@ public class PlotAnalysis {
factor_air == 1 ? 0 : (int) (factor_air * 1000 / MathMan.getMean(air)); factor_air == 1 ? 0 : (int) (factor_air * 1000 / MathMan.getMean(air));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | air {}", factor_air); logger.info("- | air {}", factor_air);
} }
int[] rank_variety = rank(variety); int[] rank_variety = rank(variety);
@ -325,7 +325,7 @@ public class PlotAnalysis {
(int) (factor_variety * 1000 / MathMan.getMean(variety)); (int) (factor_variety * 1000 / MathMan.getMean(variety));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | variety {}", factor_variety); logger.info("- | variety {}", factor_variety);
} }
int[] rank_changes_sd = rank(changes_sd); int[] rank_changes_sd = rank(changes_sd);
@ -338,7 +338,7 @@ public class PlotAnalysis {
(int) (factor_changes_sd * 1000 / MathMan.getMean(changes_sd)); (int) (factor_changes_sd * 1000 / MathMan.getMean(changes_sd));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | changed_sd {}", factor_changes_sd); logger.info(" - | changed_sd {}", factor_changes_sd);
} }
int[] rank_faces_sd = rank(faces_sd); int[] rank_faces_sd = rank(faces_sd);
@ -351,7 +351,7 @@ public class PlotAnalysis {
(int) (factor_faces_sd * 1000 / MathMan.getMean(faces_sd)); (int) (factor_faces_sd * 1000 / MathMan.getMean(faces_sd));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | faced_sd {}", factor_faces_sd); logger.info(" - | faced_sd {}", factor_faces_sd);
} }
int[] rank_data_sd = rank(data_sd); int[] rank_data_sd = rank(data_sd);
@ -364,7 +364,7 @@ public class PlotAnalysis {
(int) (factor_data_sd * 1000 / MathMan.getMean(data_sd)); (int) (factor_data_sd * 1000 / MathMan.getMean(data_sd));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | data_sd {}", factor_data_sd); logger.info(" - | data_sd {}", factor_data_sd);
} }
int[] rank_air_sd = rank(air_sd); int[] rank_air_sd = rank(air_sd);
@ -376,7 +376,7 @@ public class PlotAnalysis {
factor_air_sd == 1 ? 0 : (int) (factor_air_sd * 1000 / MathMan.getMean(air_sd)); factor_air_sd == 1 ? 0 : (int) (factor_air_sd * 1000 / MathMan.getMean(air_sd));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | air_sd {}", factor_air_sd); logger.info(" - | air_sd {}", factor_air_sd);
} }
int[] rank_variety_sd = rank(variety_sd); int[] rank_variety_sd = rank(variety_sd);
@ -389,13 +389,13 @@ public class PlotAnalysis {
(int) (factor_variety_sd * 1000 / MathMan.getMean(variety_sd)); (int) (factor_variety_sd * 1000 / MathMan.getMean(variety_sd));
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - | variety_sd {}", factor_variety_sd); logger.info(" - | variety_sd {}", factor_variety_sd);
} }
int[] complexity = new int[n]; int[] complexity = new int[n];
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Calculating threshold"); logger.info(" Calculating threshold");
} }
int max = 0; int max = 0;
@ -427,7 +427,7 @@ public class PlotAnalysis {
logln(getCC(n, sum(square(getSD(rankComplexity, rankRatings))))); logln(getCC(n, sum(square(getSD(rankComplexity, rankRatings)))));
if (optimalComplexity == Integer.MAX_VALUE) { if (optimalComplexity == Integer.MAX_VALUE) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Insufficient data to determine correlation! {} | {}", logger.info("Insufficient data to determine correlation! {} | {}",
optimalIndex, n); optimalIndex, n);
} }
running = false; running = false;
@ -448,7 +448,7 @@ public class PlotAnalysis {
// Save calibration // Save calibration
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Saving calibration"); logger.info(" Saving calibration");
} }
Settings.AUTO_CLEAR.put("auto-calibrated", settings); Settings.AUTO_CLEAR.put("auto-calibrated", settings);
Settings.save(PlotSquared.get().getWorldsFile()); Settings.save(PlotSquared.get().getWorldsFile());
@ -457,7 +457,7 @@ public class PlotAnalysis {
plot.removeRunning(); plot.removeRunning();
} }
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Done!"); logger.info(" Done!");
} }
whenDone.run(); whenDone.run();
} }
@ -466,7 +466,7 @@ public class PlotAnalysis {
public static void logln(Object obj) { public static void logln(Object obj) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] " + log(obj)); logger.info("" + log(obj));
} }
} }

View File

@ -149,7 +149,7 @@ public class FlagContainer {
this.updateSubscribers this.updateSubscribers
.forEach(subscriber -> subscriber.handle(flag, plotFlagUpdateType)); .forEach(subscriber -> subscriber.handle(flag, plotFlagUpdateType));
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
logger.info("[P2] Flag {} (class '{}') could not be added to the container because the " logger.info("Flag {} (class '{}') could not be added to the container because the "
+ "flag name exceeded the allowed limit of 64 characters. Please tell the developer " + "flag name exceeded the allowed limit of 64 characters. Please tell the developer "
+ "of the flag to fix this.", flag.getName(), flag.getClass().getName()); + "of the flag to fix this.", flag.getName(), flag.getClass().getName());
e.printStackTrace(); e.printStackTrace();

View File

@ -133,7 +133,7 @@ public class BlockTypeWrapper {
this.blockCategory = BlockCategory.REGISTRY.get(this.blockCategoryId); this.blockCategory = BlockCategory.REGISTRY.get(this.blockCategoryId);
if (this.blockCategory == null && !BlockCategory.REGISTRY.values().isEmpty()) { if (this.blockCategory == null && !BlockCategory.REGISTRY.values().isEmpty()) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] - Block category #{} does not exist", this.blockCategoryId); logger.info("- Block category #{} does not exist", this.blockCategoryId);
} }
this.blockCategory = new NullBlockCategory(this.blockCategoryId); this.blockCategory = new NullBlockCategory(this.blockCategoryId);
} }

View File

@ -72,7 +72,7 @@ public abstract class Expression<T> {
return (Double) exec.getEngine().eval(expression.replace("{arg}", "" + arg)); return (Double) exec.getEngine().eval(expression.replace("{arg}", "" + arg));
} catch (ScriptException e) { } catch (ScriptException e) {
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.info("[P2] Invalid expression: {}", expression); logger.info("Invalid expression: {}", expression);
} }
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -89,7 +89,7 @@ public abstract class RegionManager {
for (BlockVector2 loc : chunks) { for (BlockVector2 loc : chunks) {
String directory = world + File.separator + "region" + File.separator + "r." + loc.getX() + "." + loc.getZ() + ".mca"; String directory = world + File.separator + "region" + File.separator + "r." + loc.getX() + "." + loc.getZ() + ".mca";
File file = new File(PlotSquared.platform().getWorldContainer(), directory); File file = new File(PlotSquared.platform().getWorldContainer(), directory);
logger.info("[P2] - Deleting file: {} (max 1024 chunks)", file.getName()); logger.info("- Deleting file: {} (max 1024 chunks)", file.getName());
if (file.exists()) { if (file.exists()) {
file.delete(); file.delete();
} }

View File

@ -236,7 +236,7 @@ public abstract class SchematicHandler {
TaskManager.runTaskAsync(() -> { TaskManager.runTaskAsync(() -> {
boolean result = save(value, directory + File.separator + name + ".schem"); boolean result = save(value, directory + File.separator + name + ".schem");
if (!result) { if (!result) {
logger.error("[P2] Failed to save {}", plot.getId()); logger.error("Failed to save {}", plot.getId());
} }
TaskManager.runTask(THIS); TaskManager.runTask(THIS);
}); });

View File

@ -161,7 +161,7 @@ public final class IncendoPaster {
if (!httpURLConnection.getResponseMessage().contains("OK")) { if (!httpURLConnection.getResponseMessage().contains("OK")) {
if (httpURLConnection.getResponseCode() == 413) { if (httpURLConnection.getResponseCode() == 413) {
final long size = content.length; final long size = content.length;
logger.error("[P2] Paste too big > size: {}MB", size / 1_000_000); logger.error("Paste too big > size: {}MB", size / 1_000_000);
} }
throw new IllegalStateException(String throw new IllegalStateException(String
.format("Server returned status: %d %s", httpURLConnection.getResponseCode(), .format("Server returned status: %d %s", httpURLConnection.getResponseCode(),

View File

@ -173,7 +173,7 @@ public class UUIDPipeline {
} catch (TimeoutException ignored) { } catch (TimeoutException ignored) {
// This is completely valid, we just don't care anymore // This is completely valid, we just don't care anymore
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.warn("[P2] (UUID) Request for {} timed out", username); logger.warn("(UUID) Request for {} timed out", username);
} }
} }
return null; return null;
@ -198,7 +198,7 @@ public class UUIDPipeline {
} catch (TimeoutException ignored) { } catch (TimeoutException ignored) {
// This is completely valid, we just don't care anymore // This is completely valid, we just don't care anymore
if (Settings.DEBUG) { if (Settings.DEBUG) {
logger.warn("[P2] (UUID) Request for {} timed out", uuid); logger.warn("(UUID) Request for {} timed out", uuid);
} }
} }
return null; return null;
@ -328,7 +328,7 @@ public class UUIDPipeline {
this.consume(mappings); this.consume(mappings);
return mappings; return mappings;
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] (UUID) Failed to find all usernames"); logger.info("(UUID) Failed to find all usernames");
} }
if (Settings.UUID.UNKNOWN_AS_DEFAULT) { if (Settings.UUID.UNKNOWN_AS_DEFAULT) {
@ -391,7 +391,7 @@ public class UUIDPipeline {
this.consume(mappings); this.consume(mappings);
return mappings; return mappings;
} else if (Settings.DEBUG) { } else if (Settings.DEBUG) {
logger.info("[P2] (UUID) Failed to find all UUIDs"); logger.info("(UUID) Failed to find all UUIDs");
} }
throw new ServiceError("End of pipeline"); throw new ServiceError("End of pipeline");