{
}
@Override public void sendMessage(String message) {
- PlotSquared.log(message);
+ logger.info(message);
}
@Override public void teleport(Location location, TeleportCause cause) {
diff --git a/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java b/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
index b11a33ba6..a1d178469 100644
--- a/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
+++ b/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
@@ -54,6 +54,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.item.ItemType;
import lombok.NonNull;
import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.util.Collection;
@@ -73,6 +75,8 @@ import java.util.stream.Collectors;
*/
public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotPlayer.class.getSimpleName());
+
public static final String META_LAST_PLOT = "lastplot";
public static final String META_LOCATION = "location";
@@ -580,9 +584,9 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
if (Settings.Enabled_Components.BAN_DELETER && isBanned()) {
for (Plot owned : getPlots()) {
owned.deletePlot(null);
- PlotSquared.debug(String
- .format("&cPlot &6%s &cwas deleted + cleared due to &6%s&c getting banned",
- plot.getId(), getName()));
+ if (Settings.DEBUG) {
+ logger.info("[P2] Plot {} was deleted + cleared due to {} getting banned", owned.getId(), getName());
+ }
}
}
if (ExpireManager.IMP != null) {
diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java
index 2adca5334..f0bd35552 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java
@@ -73,6 +73,8 @@ import com.sk89q.worldedit.world.block.BlockTypes;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
@@ -117,6 +119,8 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
*/
public class Plot {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + Plot.class.getSimpleName());
+
public static final int MAX_HEIGHT = 256;
private static Set connected_cache;
@@ -1731,9 +1735,6 @@ public class Plot {
public boolean claim(@NotNull final PlotPlayer player, boolean teleport, String schematic) {
if (!canClaim(player)) {
- PlotSquared.debug(Captions.PREFIX.getTranslated() + String
- .format("Player %s attempted to claim plot %s, but was not allowed",
- player.getName(), this.getId().toCommaSeparatedString()));
return false;
}
return claim(player, teleport, schematic, true);
@@ -1744,9 +1745,8 @@ public class Plot {
if (updateDB) {
if (!create(player.getUUID(), true)) {
- PlotSquared.debug(Captions.PREFIX.getTranslated() + String.format(
- "Player %s attempted to claim plot %s, but the database failed to update",
- player.getName(), this.getId().toCommaSeparatedString()));
+ logger.error("[P2] Player {} attempted to claim plot {}, but the database failed to update",
+ player.getName(), this.getId().toCommaSeparatedString());
return false;
}
} else {
@@ -1834,9 +1834,8 @@ public class Plot {
});
return true;
}
- PlotSquared.get().getLogger().log(Captions.PREFIX.getTranslated() + String
- .format("Failed to add plot %s to plot area %s", this.getId().toCommaSeparatedString(),
- this.area.toString()));
+ logger.info("[P2] Failed to add plot {} to plot area {}",
+ this.getId().toCommaSeparatedString(), this.area.toString());
return false;
}
@@ -1934,12 +1933,10 @@ public class Plot {
*/
public boolean moveData(Plot plot, Runnable whenDone) {
if (!this.hasOwner()) {
- PlotSquared.debug(plot + " is unowned (single)");
TaskManager.runTask(whenDone);
return false;
}
if (plot.hasOwner()) {
- PlotSquared.debug(plot + " is unowned (multi)");
TaskManager.runTask(whenDone);
return false;
}
@@ -2647,7 +2644,6 @@ public class Plot {
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.NORTH));
if (!tmp.getMerged(Direction.SOUTH)) {
// invalid merge
- PlotSquared.debug("Fixing invalid merge: " + this);
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
tmp.getSettings().setMerged(Direction.SOUTH, true);
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
@@ -2664,7 +2660,6 @@ public class Plot {
assert tmp != null;
if (!tmp.getMerged(Direction.WEST)) {
// invalid merge
- PlotSquared.debug("Fixing invalid merge: " + this);
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
tmp.getSettings().setMerged(Direction.WEST, true);
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
@@ -2681,7 +2676,6 @@ public class Plot {
assert tmp != null;
if (!tmp.getMerged(Direction.NORTH)) {
// invalid merge
- PlotSquared.debug("Fixing invalid merge: " + this);
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
tmp.getSettings().setMerged(Direction.NORTH, true);
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
@@ -2697,7 +2691,6 @@ public class Plot {
tmp = this.area.getPlotAbs(this.id.getRelative(Direction.WEST));
if (!tmp.getMerged(Direction.EAST)) {
// invalid merge
- PlotSquared.debug("Fixing invalid merge: " + this);
if (tmp.isOwnerAbs(this.getOwnerAbs())) {
tmp.getSettings().setMerged(Direction.EAST, true);
DBFunc.setMerged(tmp, tmp.getSettings().getMerged());
@@ -2712,10 +2705,6 @@ public class Plot {
Plot current;
while ((current = frontier.poll()) != null) {
if (!current.hasOwner() || current.settings == null) {
- // Invalid plot
- // merged onto unclaimed plot
- PlotSquared.debug(
- "Ignoring invalid merged plot: " + current + " | " + current.getOwnerAbs());
continue;
}
tmpSet.add(current);
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
index 08ac2f962..25230ab89 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
@@ -66,6 +66,8 @@ import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
@@ -85,6 +87,8 @@ import java.util.function.Consumer;
*/
public abstract class PlotArea {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotArea.class.getSimpleName());
+
protected final ConcurrentHashMap plots = new ConcurrentHashMap<>();
@Getter @NotNull private final String worldName;
@Getter private final String id;
@@ -369,7 +373,6 @@ public abstract class PlotArea {
}
}
- PlotSquared.log(Captions.PREFIX + "&3 - default flags: &7" + flagBuilder.toString());
this.spawnEggs = config.getBoolean("event.spawn.egg");
this.spawnCustom = config.getBoolean("event.spawn.custom");
this.spawnBreeding = config.getBoolean("event.spawn.breeding");
@@ -405,7 +408,8 @@ public abstract class PlotArea {
prefix = ", ";
}
}
- PlotSquared.log(Captions.PREFIX + "&3 - road flags: &7" + roadFlagBuilder.toString());
+
+ logger.info("[P2] - road flags: {}", roadFlagBuilder.toString());
loadConfiguration(config);
}
@@ -1101,10 +1105,12 @@ public abstract class PlotArea {
try {
flags.add(flagInstance.parse(split[1]));
} catch (final FlagParseException e) {
- PlotSquared.log(Captions.PREFIX.getTranslated() + String.format(
- "§cFailed to parse default flag with key §6'%s'§c and value: §6'%s'§c."
- + " Reason: %s. This flag will not be added as a default flag.",
- e.getFlag().getName(), e.getValue(), e.getErrorMessage()));
+ logger.warn("[P2] Failed to parse default flag with key '{}' and value '{}'. "
+ + "Reason: {}. This flag will not be added as a default flag.",
+ e.getFlag().getName(),
+ e.getValue(),
+ e.getErrorMessage());
+ e.printStackTrace();
}
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
index 88f9c100c..814aba558 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
@@ -25,13 +25,16 @@
*/
package com.plotsquared.core.plot;
-import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.util.InventoryUtil;
import lombok.NonNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class PlotInventory {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotInventory.class.getSimpleName());
+
private static final String META_KEY = "inventory";
public final PlotPlayer> player;
public final int size;
@@ -78,10 +81,7 @@ public class PlotInventory {
if (this.title == null) {
return;
}
- if (hasPlotInventoryOpen(player)) {
- PlotSquared.debug(String.format("Failed to open plot inventory for %s "
- + "because the player already has an open plot inventory", player.getName()));
- } else {
+ if (!hasPlotInventoryOpen(player)) {
this.open = true;
setPlotInventoryOpen(player, this);
InventoryUtil.manager.open(this);
diff --git a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
index 532134536..b697db52c 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
@@ -43,10 +43,11 @@ import com.plotsquared.core.plot.flag.implementations.AnalysisFlag;
import com.plotsquared.core.plot.flag.implementations.KeepFlag;
import com.plotsquared.core.plot.message.PlotMessage;
import com.plotsquared.core.util.MainUtil;
-import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.util.task.TaskManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -55,13 +56,14 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Objects;
-import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
public class ExpireManager {
+ private final Logger logger = LoggerFactory.getLogger("P2/" + ExpireManager.class);
+
public static ExpireManager IMP;
private final ConcurrentHashMap dates_cache;
private final ConcurrentHashMap account_age_cache;
@@ -79,7 +81,6 @@ public class ExpireManager {
}
public void addTask(ExpiryTask task) {
- PlotSquared.debug("Adding new expiry task!");
this.tasks.add(task);
}
@@ -420,21 +421,7 @@ public class ExpireManager {
MainUtil.sendMessage(player, Captions.PLOT_REMOVED_USER, plot.toString());
}
}
- Set plots = plot.getConnectedPlots();
plot.deletePlot(whenDone);
- PlotAnalysis changed = plot.getComplexity(null);
- int changes = changed == null ? 0 : changed.changes_sd;
- int modified = changed == null ? 0 : changed.changes;
- PlotSquared.debug(
- "$2[&5Expire&dManager$2] &cDeleted expired plot: " + plot + " User:" + plot.getOwner()
- + " Delta:" + changes + "/" + modified + " Connected: " + StringMan
- .getString(plots));
- PlotSquared.debug("$4 - Area: " + plot.getArea());
- if (plot.hasOwner()) {
- PlotSquared.debug("$4 - Owner: " + plot.getOwner());
- } else {
- PlotSquared.debug("$4 - Owner: Unowned");
- }
}
public long getAge(UUID uuid) {
diff --git a/Core/src/main/java/com/plotsquared/core/plot/expiration/PlotAnalysis.java b/Core/src/main/java/com/plotsquared/core/plot/expiration/PlotAnalysis.java
index f7d326411..0cfa1e1d9 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/expiration/PlotAnalysis.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/expiration/PlotAnalysis.java
@@ -33,6 +33,8 @@ import com.plotsquared.core.plot.flag.implementations.AnalysisFlag;
import com.plotsquared.core.util.MathMan;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.lang.reflect.Array;
import java.util.ArrayDeque;
@@ -43,6 +45,9 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
public class PlotAnalysis {
+
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotAnalysis.class.getSimpleName());
+
public static boolean running = false;
public int changes;
public int faces;
@@ -91,22 +96,26 @@ public class PlotAnalysis {
*/
public static void calcOptimalModifiers(final Runnable whenDone, final double threshold) {
if (running) {
- PlotSquared.debug("Calibration task already in progress!");
+ if (Settings.DEBUG) {
+ logger.info("[P2] Calibration task already in progress!");
+ }
return;
}
if (threshold <= 0 || threshold >= 1) {
- PlotSquared.debug(
- "Invalid threshold provided! (Cannot be 0 or 100 as then there's no point calibrating)");
+ if (Settings.DEBUG) {
+ logger.info(
+ "Invalid threshold provided! (Cannot be 0 or 100 as then there's no point in calibrating)");
+ }
return;
}
running = true;
- PlotSquared.debug(" - Fetching all plots");
final ArrayList plots = new ArrayList<>(PlotSquared.get().getPlots());
TaskManager.runTaskAsync(new Runnable() {
@Override public void run() {
Iterator iterator = plots.iterator();
- PlotSquared.debug(
- " - $1Reducing " + plots.size() + " plots to those with sufficient data");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Reducing {} plots to those with sufficient data", plots.size());
+ }
while (iterator.hasNext()) {
Plot plot = iterator.next();
if (plot.getSettings().getRatings() == null || plot.getSettings().getRatings()
@@ -116,11 +125,12 @@ public class PlotAnalysis {
plot.addRunning();
}
}
- PlotSquared.debug(" - | Reduced to " + plots.size() + " plots");
if (plots.size() < 3) {
- PlotSquared.debug(
- "Calibration cancelled due to insufficient comparison data, please try again later");
+ if (Settings.DEBUG) {
+ logger.info(
+ "Calibration cancelled due to insufficient comparison data, please try again later");
+ }
running = false;
for (Plot plot : plots) {
plot.removeRunning();
@@ -128,7 +138,9 @@ public class PlotAnalysis {
return;
}
- PlotSquared.debug(" - $1Analyzing plot contents (this may take a while)");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Analyzing plot contents (this may take a while)");
+ }
int[] changes = new int[plots.size()];
int[] faces = new int[plots.size()];
@@ -154,7 +166,9 @@ public class PlotAnalysis {
ratings[i] = (int) (
(plot.getAverageRating() + plot.getSettings().getRatings().size())
* 100);
- PlotSquared.debug(" | " + plot + " (rating) " + ratings[i]);
+ if (Settings.DEBUG) {
+ logger.info("[P2] | {} (rating) {}", plot, ratings[i]);
+ }
}
}
});
@@ -166,7 +180,9 @@ public class PlotAnalysis {
if (queuePlot == null) {
break;
}
- PlotSquared.debug(" | " + queuePlot);
+ if (Settings.DEBUG) {
+ logger.info("[P2] | {}", queuePlot);
+ }
final Object lock = new Object();
TaskManager.runTask(new Runnable() {
@Override public void run() {
@@ -196,20 +212,25 @@ public class PlotAnalysis {
}
}
- PlotSquared.debug(
- " - $1Waiting on plot rating thread: " + mi.intValue() * 100 / plots.size()
- + "%");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Waiting on plot rating thread: {}%", mi.intValue() * 100 / plots.size());
+ }
+
try {
ratingAnalysis.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
- PlotSquared
- .debug(" - $1Processing and grouping single plot analysis for bulk processing");
+ if (Settings.DEBUG) {
+ logger.info(
+ " - Processing and grouping single plot analysis for bulk processing");
+ }
for (int i = 0; i < plots.size(); i++) {
Plot plot = plots.get(i);
- PlotSquared.debug(" | " + plot);
+ if (Settings.DEBUG) {
+ logger.info("[P2] | {}", plot);
+ }
PlotAnalysis analysis = plot.getComplexity(null);
changes[i] = analysis.changes;
@@ -225,18 +246,22 @@ public class PlotAnalysis {
variety_sd[i] = analysis.variety_sd;
}
- PlotSquared.debug(" - $1Calculating rankings");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Calculating rankings");
+ }
int[] rankRatings = rank(ratings);
int n = rankRatings.length;
int optimalIndex = (int) Math.round((1 - threshold) * (n - 1));
- PlotSquared.debug(" - $1Calculating rank correlation: ");
- PlotSquared.debug(
- " - The analyzed plots which were processed and put into bulk data will be compared and correlated to the plot ranking");
- PlotSquared.debug(
- " - The calculated correlation constant will then be used to calibrate the threshold for auto plot clearing");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Calculating rank correlation: ");
+ logger.info(
+ " - The analyzed plots which were processed and put into bulk data will be compared and correlated to the plot ranking");
+ logger.info(
+ " - The calculated correlation constant will then be used to calibrate the threshold for auto plot clearing");
+ }
Settings.Auto_Clear settings = new Settings.Auto_Clear();
@@ -248,7 +273,10 @@ public class PlotAnalysis {
settings.CALIBRATION.CHANGES = factorChanges == 1 ?
0 :
(int) (factorChanges * 1000 / MathMan.getMean(changes));
- PlotSquared.debug(" - | changes " + factorChanges);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | changes {}", factorChanges);
+ }
int[] rankFaces = rank(faces);
int[] sdFaces = getSD(rankFaces, rankRatings);
@@ -257,7 +285,10 @@ public class PlotAnalysis {
double factorFaces = getCC(n, sumFaces);
settings.CALIBRATION.FACES =
factorFaces == 1 ? 0 : (int) (factorFaces * 1000 / MathMan.getMean(faces));
- PlotSquared.debug(" - | faces " + factorFaces);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | faces {}", factorFaces);
+ }
int[] rankData = rank(data);
int[] sdData = getSD(rankData, rankRatings);
@@ -266,7 +297,10 @@ public class PlotAnalysis {
double factor_data = getCC(n, sum_data);
settings.CALIBRATION.DATA =
factor_data == 1 ? 0 : (int) (factor_data * 1000 / MathMan.getMean(data));
- PlotSquared.debug(" - | data " + factor_data);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | data {}", factor_data);
+ }
int[] rank_air = rank(air);
int[] sd_air = getSD(rank_air, rankRatings);
@@ -275,7 +309,10 @@ public class PlotAnalysis {
double factor_air = getCC(n, sum_air);
settings.CALIBRATION.AIR =
factor_air == 1 ? 0 : (int) (factor_air * 1000 / MathMan.getMean(air));
- PlotSquared.debug(" - | air " + factor_air);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | air {}", factor_air);
+ }
int[] rank_variety = rank(variety);
int[] sd_variety = getSD(rank_variety, rankRatings);
@@ -285,7 +322,10 @@ public class PlotAnalysis {
settings.CALIBRATION.VARIETY = factor_variety == 1 ?
0 :
(int) (factor_variety * 1000 / MathMan.getMean(variety));
- PlotSquared.debug(" - | variety " + factor_variety);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | variety {}", factor_variety);
+ }
int[] rank_changes_sd = rank(changes_sd);
int[] sd_changes_sd = getSD(rank_changes_sd, rankRatings);
@@ -295,7 +335,10 @@ public class PlotAnalysis {
settings.CALIBRATION.CHANGES_SD = factor_changes_sd == 1 ?
0 :
(int) (factor_changes_sd * 1000 / MathMan.getMean(changes_sd));
- PlotSquared.debug(" - | changes_sd " + factor_changes_sd);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | changed_sd {}", factor_changes_sd);
+ }
int[] rank_faces_sd = rank(faces_sd);
int[] sd_faces_sd = getSD(rank_faces_sd, rankRatings);
@@ -305,7 +348,10 @@ public class PlotAnalysis {
settings.CALIBRATION.FACES_SD = factor_faces_sd == 1 ?
0 :
(int) (factor_faces_sd * 1000 / MathMan.getMean(faces_sd));
- PlotSquared.debug(" - | faces_sd " + factor_faces_sd);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | faced_sd {}", factor_faces_sd);
+ }
int[] rank_data_sd = rank(data_sd);
int[] sd_data_sd = getSD(rank_data_sd, rankRatings);
@@ -315,7 +361,10 @@ public class PlotAnalysis {
settings.CALIBRATION.DATA_SD = factor_data_sd == 1 ?
0 :
(int) (factor_data_sd * 1000 / MathMan.getMean(data_sd));
- PlotSquared.debug(" - | data_sd " + factor_data_sd);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | data_sd {}", factor_data_sd);
+ }
int[] rank_air_sd = rank(air_sd);
int[] sd_air_sd = getSD(rank_air_sd, rankRatings);
@@ -324,7 +373,10 @@ public class PlotAnalysis {
double factor_air_sd = getCC(n, sum_air_sd);
settings.CALIBRATION.AIR_SD =
factor_air_sd == 1 ? 0 : (int) (factor_air_sd * 1000 / MathMan.getMean(air_sd));
- PlotSquared.debug(" - | air_sd " + factor_air_sd);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | air_sd {}", factor_air_sd);
+ }
int[] rank_variety_sd = rank(variety_sd);
int[] sd_variety_sd = getSD(rank_variety_sd, rankRatings);
@@ -334,11 +386,17 @@ public class PlotAnalysis {
settings.CALIBRATION.VARIETY_SD = factor_variety_sd == 1 ?
0 :
(int) (factor_variety_sd * 1000 / MathMan.getMean(variety_sd));
- PlotSquared.debug(" - | variety_sd " + factor_variety_sd);
+
+ if (Settings.DEBUG) {
+ logger.info("[P2] - | variety_sd {}", factor_variety_sd);
+ }
int[] complexity = new int[n];
- PlotSquared.debug(" $1Calculating threshold");
+ if (Settings.DEBUG) {
+ logger.info("[P2] Calculating threshold");
+ }
+
int max = 0;
int min = 0;
for (int i = 0; i < n; i++) {
@@ -367,9 +425,10 @@ public class PlotAnalysis {
logln("Correlation: ");
logln(getCC(n, sum(square(getSD(rankComplexity, rankRatings)))));
if (optimalComplexity == Integer.MAX_VALUE) {
- PlotSquared.debug(
- "Insufficient data to determine correlation! " + optimalIndex + " | "
- + n);
+ if (Settings.DEBUG) {
+ logger.info("[P2] Insufficient data to determine correlation! {} | {}",
+ optimalIndex, n);
+ }
running = false;
for (Plot plot : plots) {
plot.removeRunning();
@@ -387,21 +446,27 @@ public class PlotAnalysis {
}
// Save calibration
- PlotSquared.debug(" $1Saving calibration");
+ if (Settings.DEBUG) {
+ logger.info("[P2] Saving calibration");
+ }
Settings.AUTO_CLEAR.put("auto-calibrated", settings);
Settings.save(PlotSquared.get().worldsFile);
- PlotSquared.debug("$1Done!");
running = false;
for (Plot plot : plots) {
plot.removeRunning();
}
+ if (Settings.DEBUG) {
+ logger.info("[P2] Done!");
+ }
whenDone.run();
}
});
}
public static void logln(Object obj) {
- PlotSquared.debug(log(obj));
+ if (Settings.DEBUG) {
+ logger.info("[P2] " + log(obj));
+ }
}
public static String log(Object obj) {
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
index e0bb40fb8..871cf48c7 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
@@ -27,11 +27,12 @@ package com.plotsquared.core.plot.flag;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
-import com.plotsquared.core.PlotSquared;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
@@ -44,6 +45,8 @@ import java.util.Map;
*/
@EqualsAndHashCode(of = "flagMap") public class FlagContainer {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + FlagContainer.class.getSimpleName());
+
private final Map unknownFlags = new HashMap<>();
private final Map, PlotFlag, ?>> flagMap = new HashMap<>();
private final PlotFlagUpdateHandler plotFlagUpdateHandler;
@@ -145,11 +148,9 @@ import java.util.Map;
this.updateSubscribers
.forEach(subscriber -> subscriber.handle(flag, plotFlagUpdateType));
} catch (IllegalStateException e) {
- PlotSquared.log(String.format(
- "Flag '%s' (class: '%s') could not be added to the container"
- + " because the flag name exceeded the allowed limit of 64 characters."
- + " Please tell the developer of that flag to fix this.", flag.getName(),
- flag.getClass().getName()));
+ logger.info("[P2] Flag {} (class '{}') could not be added to the container because the "
+ + "flag name exceeded the allowed limit of 64 characters. Please tell the developer "
+ + "of the flag to fix this.", flag.getName(), flag.getClass().getName());
e.printStackTrace();
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java
index 9af840d4c..dd5dd34af 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java
@@ -27,13 +27,15 @@ package com.plotsquared.core.plot.flag.types;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
-import com.plotsquared.core.PlotSquared;
+import com.plotsquared.core.configuration.Settings;
import com.sk89q.worldedit.world.block.BlockCategory;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
@@ -44,6 +46,8 @@ import java.util.Map;
*/
public class BlockTypeWrapper {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + BlockTypeWrapper.class.getSimpleName());
+
private static final Map blockTypes = new HashMap<>();
private static final Map blockCategories = new HashMap<>();
@Nullable @Getter private final BlockType blockType;
@@ -129,7 +133,9 @@ public class BlockTypeWrapper {
&& this.blockCategoryId != null) { // only if name is available
this.blockCategory = BlockCategory.REGISTRY.get(this.blockCategoryId);
if (this.blockCategory == null && !BlockCategory.REGISTRY.values().isEmpty()) {
- PlotSquared.debug("- Block category #" + this.blockCategoryId + " does not exist");
+ if (Settings.DEBUG) {
+ logger.info("[P2] - Block category #{} does not exist", this.blockCategoryId);
+ }
this.blockCategory = new NullBlockCategory(this.blockCategoryId);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java b/Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java
index 95ae8e953..e5d431935 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/message/PlotMessage.java
@@ -29,18 +29,20 @@ import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.util.ChatManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class PlotMessage {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotMessage.class.getSimpleName());
+
private Object builder;
public PlotMessage() {
try {
reset(ChatManager.manager);
} catch (Throwable e) {
- PlotSquared.debug(
- PlotSquared.imp().getPluginName() + " doesn't support fancy chat for " + PlotSquared
- .get().IMP.getServerVersion());
+ logger.error("[P2] {} doesn't support fancy chat for {}", PlotSquared.imp().getPluginName(), PlotSquared.get().IMP.getServerVersion());
ChatManager.manager = new PlainChatManager();
reset(ChatManager.manager);
}
diff --git a/Core/src/main/java/com/plotsquared/core/queue/LocationOffsetDelegateLocalBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/LocationOffsetDelegateLocalBlockQueue.java
index cea58a95d..eefae99d3 100644
--- a/Core/src/main/java/com/plotsquared/core/queue/LocationOffsetDelegateLocalBlockQueue.java
+++ b/Core/src/main/java/com/plotsquared/core/queue/LocationOffsetDelegateLocalBlockQueue.java
@@ -25,17 +25,20 @@
*/
package com.plotsquared.core.queue;
-import com.plotsquared.core.PlotSquared;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
public class LocationOffsetDelegateLocalBlockQueue extends DelegateLocalBlockQueue {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + LocationOffsetDelegateLocalBlockQueue.class.getSimpleName());
+
private final boolean[][] canPlace;
private final int blockX;
private final int blockZ;
@@ -61,10 +64,6 @@ public class LocationOffsetDelegateLocalBlockQueue extends DelegateLocalBlockQue
return super.setBlock(x, y, z, id);
}
} catch (final Exception e) {
- PlotSquared.debug(String.format(
- "Failed to set block at: %d;%d;%d (to = %s) with offset %d;%d."
- + " Translated to: %d;%d", x, y, z, id, blockX, blockZ, x - blockX,
- z - blockZ));
throw e;
}
return false;
diff --git a/Core/src/main/java/com/plotsquared/core/util/Expression.java b/Core/src/main/java/com/plotsquared/core/util/Expression.java
index 86bdeea2d..94d1aefc8 100644
--- a/Core/src/main/java/com/plotsquared/core/util/Expression.java
+++ b/Core/src/main/java/com/plotsquared/core/util/Expression.java
@@ -25,13 +25,18 @@
*/
package com.plotsquared.core.util;
-import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.command.DebugExec;
import com.plotsquared.core.command.MainCommand;
+import com.plotsquared.core.configuration.Settings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.script.ScriptException;
public abstract class Expression {
+
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + Expression.class.getSimpleName());
+
public static Expression constant(final U value) {
return new Expression() {
@Override public U evaluate(U arg) {
@@ -66,7 +71,9 @@ public abstract class Expression {
try {
return (Double) exec.getEngine().eval(expression.replace("{arg}", "" + arg));
} catch (ScriptException e) {
- PlotSquared.debug("Invalid Expression: " + expression);
+ if (Settings.DEBUG) {
+ logger.info("[P2] Invalid expression: {}", expression);
+ }
e.printStackTrace();
}
return 0d;
diff --git a/Core/src/main/java/com/plotsquared/core/util/LegacyConverter.java b/Core/src/main/java/com/plotsquared/core/util/LegacyConverter.java
index d329a8e23..70e46e406 100644
--- a/Core/src/main/java/com/plotsquared/core/util/LegacyConverter.java
+++ b/Core/src/main/java/com/plotsquared/core/util/LegacyConverter.java
@@ -25,7 +25,6 @@
*/
package com.plotsquared.core.util;
-import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.CaptionUtility;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationSection;
@@ -33,6 +32,8 @@ import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.plot.BlockBucket;
import com.sk89q.worldedit.world.block.BlockState;
import lombok.NonNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.HashMap;
@@ -45,6 +46,7 @@ import java.util.Map;
@SuppressWarnings("unused")
public final class LegacyConverter {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + LegacyConverter.class.getSimpleName());
public static final String CONFIGURATION_VERSION = "post_flattening";
private static final HashMap TYPE_MAP = new HashMap<>();
@@ -109,7 +111,7 @@ public final class LegacyConverter {
@NonNull final String key, @NonNull final String block) {
final BlockBucket bucket = this.blockToBucket(block);
this.setString(section, key, bucket);
- PlotSquared.log(CaptionUtility
+ logger.info(CaptionUtility
.format(ConsolePlayer.getConsole(), Captions.LEGACY_CONFIG_REPLACED.getTranslated(),
block, bucket.toString()));
}
@@ -119,7 +121,7 @@ public final class LegacyConverter {
final BlockState[] blocks = this.splitBlockList(blockList);
final BlockBucket bucket = this.blockListToBucket(blocks);
this.setString(section, key, bucket);
- PlotSquared.log(CaptionUtility
+ logger.info(CaptionUtility
.format(ConsolePlayer.getConsole(), Captions.LEGACY_CONFIG_REPLACED.getTranslated(),
plotBlockArrayString(blocks), bucket.toString()));
}
diff --git a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java b/Core/src/main/java/com/plotsquared/core/util/MainUtil.java
index 9f79f3273..2c9c2a60b 100644
--- a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java
+++ b/Core/src/main/java/com/plotsquared/core/util/MainUtil.java
@@ -56,6 +56,8 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
@@ -97,6 +99,7 @@ import java.util.stream.IntStream;
*/
public class MainUtil {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + MainUtil.class.getSimpleName());
private static final DecimalFormat FLAG_DECIMAL_FORMAT = new DecimalFormat("0");
static {
@@ -153,7 +156,6 @@ public class MainUtil {
public static void upload(UUID uuid, String file, String extension,
final RunnableVal writeTask, final RunnableVal whenDone) {
if (writeTask == null) {
- PlotSquared.debug("&cWrite task cannot be null");
TaskManager.runTask(whenDone);
return;
}
@@ -215,7 +217,6 @@ public class MainUtil {
content = scanner.next().trim();
}
if (!content.startsWith("<")) {
- PlotSquared.debug(content);
}
int responseCode = ((HttpURLConnection) con).getResponseCode();
if (responseCode == 200) {
@@ -537,11 +538,11 @@ public class MainUtil {
* @param message If a message should be sent to the player if a plot cannot be found
* @return The plot if only 1 result is found, or null
*/
- @Nullable public static Plot getPlotFromString(PlotPlayer player, String arg, boolean message) {
+ @Nullable public static Plot getPlotFromString(PlotPlayer> player, String arg, boolean message) {
if (arg == null) {
if (player == null) {
if (message) {
- PlotSquared.log(Captions.NOT_VALID_PLOT_WORLD);
+ logger.info("[P2] No plot area string was supplied");
}
return null;
}
@@ -664,7 +665,7 @@ public class MainUtil {
if (player == null) {
String message = CaptionUtility
.format(null, (prefix ? Captions.PREFIX.getTranslated() : "") + msg);
- PlotSquared.log(message);
+ logger.info(message);
} else {
player.sendMessage(CaptionUtility.format(player,
(prefix ? Captions.PREFIX.getTranslated() : "") + Captions.color(msg)));
@@ -699,7 +700,7 @@ public class MainUtil {
TaskManager.runTaskAsync(() -> {
String m = CaptionUtility.format(player, caption, args);
if (player == null) {
- PlotSquared.log(m);
+ logger.info(m);
} else {
player.sendMessage(m);
}
@@ -916,8 +917,6 @@ public class MainUtil {
for (File file : files) {
if (file.isDirectory()) {
deleteDirectory(file);
- } else {
- PlotSquared.debug("Deleting file: " + file + " | " + file.delete());
}
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java
index 1349e6c9a..c31c1dc03 100644
--- a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java
+++ b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java
@@ -37,6 +37,8 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.Collection;
@@ -45,6 +47,8 @@ import java.util.Set;
public abstract class RegionManager {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + RegionManager.class.getSimpleName());
+
public static RegionManager manager = null;
public static BlockVector2 getRegion(Location location) {
@@ -142,7 +146,7 @@ public abstract class RegionManager {
world + File.separator + "region" + File.separator + "r." + loc.getX() + "."
+ loc.getZ() + ".mca";
File file = new File(PlotSquared.get().IMP.getWorldContainer(), directory);
- PlotSquared.log("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)");
+ logger.info("[P2] - Deleting file: {} (max 1024 chunks)", file.getName());
if (file.exists()) {
file.delete();
}
diff --git a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
index 92b1b2ef4..6b8265639 100644
--- a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
+++ b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
@@ -61,6 +61,8 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
@@ -93,6 +95,8 @@ import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public abstract class SchematicHandler {
+
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + SchematicHandler.class.getSimpleName());
public static SchematicHandler manager;
private boolean exportAll = false;
@@ -146,18 +150,12 @@ public abstract class SchematicHandler {
final Runnable THIS = this;
SchematicHandler.manager.getCompoundTag(plot, new RunnableVal() {
@Override public void run(final CompoundTag value) {
- if (value == null) {
- MainUtil.sendMessage(null, "&7 - Skipped plot &c" + plot.getId());
- } else {
+ if (value != null) {
TaskManager.runTaskAsync(() -> {
- MainUtil.sendMessage(null, "&6ID: " + plot.getId());
boolean result = SchematicHandler.manager
.save(value, directory + File.separator + name + ".schem");
if (!result) {
- MainUtil
- .sendMessage(null, "&7 - Failed to save &c" + plot.getId());
- } else {
- MainUtil.sendMessage(null, "&7 - &a success: " + plot.getId());
+ logger.error("[P2] Failed to save {}", plot.getId());
}
TaskManager.runTask(THIS);
});
@@ -186,7 +184,6 @@ public abstract class SchematicHandler {
whenDone.value = false;
}
if (schematic == null) {
- PlotSquared.debug("Schematic == null :|");
TaskManager.runTask(whenDone);
return;
}
@@ -202,12 +199,6 @@ public abstract class SchematicHandler {
+ 1) < WIDTH) || (
(region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset
+ 1) < LENGTH) || (HEIGHT > 256)) {
- PlotSquared.debug("Schematic is too large");
- PlotSquared.debug(
- "(" + WIDTH + ',' + LENGTH + ',' + HEIGHT + ") is bigger than (" + (
- region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) + ','
- + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ())
- + ",256)");
TaskManager.runTask(whenDone);
return;
}
@@ -404,8 +395,6 @@ public abstract class SchematicHandler {
return new Schematic(clip);
} catch (IOException e) {
e.printStackTrace();
- PlotSquared.debug(is.toString() + " | " + is.getClass().getCanonicalName()
- + " is not in GZIP format : " + e.getMessage());
}
}
return null;
@@ -431,14 +420,12 @@ public abstract class SchematicHandler {
return schematics;
} catch (JSONException | IOException e) {
e.printStackTrace();
- PlotSquared.debug("ERROR PARSING: " + rawJSON);
}
return null;
}
public void upload(final CompoundTag tag, UUID uuid, String file, RunnableVal whenDone) {
if (tag == null) {
- PlotSquared.debug("&cCannot save empty tag");
TaskManager.runTask(whenDone);
return;
}
@@ -463,7 +450,6 @@ public abstract class SchematicHandler {
*/
public boolean save(CompoundTag tag, String path) {
if (tag == null) {
- PlotSquared.debug("&cCannot save empty tag");
return false;
}
try {
diff --git a/Core/src/main/java/com/plotsquared/core/util/logger/ILogger.java b/Core/src/main/java/com/plotsquared/core/util/logger/ILogger.java
index 3f9b3d598..c5e145812 100644
--- a/Core/src/main/java/com/plotsquared/core/util/logger/ILogger.java
+++ b/Core/src/main/java/com/plotsquared/core/util/logger/ILogger.java
@@ -25,6 +25,6 @@
*/
package com.plotsquared.core.util.logger;
-public interface ILogger {
- void log(String message);
+@Deprecated public interface ILogger {
+ @Deprecated void log(String message);
}
diff --git a/Core/src/main/java/com/plotsquared/core/util/net/IncendoPaster.java b/Core/src/main/java/com/plotsquared/core/util/net/IncendoPaster.java
index 46ae63f7d..e37744590 100644
--- a/Core/src/main/java/com/plotsquared/core/util/net/IncendoPaster.java
+++ b/Core/src/main/java/com/plotsquared/core/util/net/IncendoPaster.java
@@ -26,7 +26,8 @@
package com.plotsquared.core.util.net;
import com.google.common.base.Charsets;
-import com.plotsquared.core.PlotSquared;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -47,6 +48,8 @@ import java.util.Locale;
@SuppressWarnings({"unused", "WeakerAccess"})
public final class IncendoPaster {
+ private static Logger logger = LoggerFactory.getLogger("P2/" + IncendoPaster.class);
+
/**
* Upload service URL
*/
@@ -158,7 +161,7 @@ public final class IncendoPaster {
if (!httpURLConnection.getResponseMessage().contains("OK")) {
if (httpURLConnection.getResponseCode() == 413) {
final long size = content.length;
- PlotSquared.debug(String.format("Paste Too Big > Size: %dMB", size / 1_000_000));
+ logger.error("[P2] Paste too big > size: {}MB", size / 1_000_000);
}
throw new IllegalStateException(String
.format("Server returned status: %d %s", httpURLConnection.getResponseCode(),
diff --git a/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java b/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
index 997cdfdc1..7520b66a6 100644
--- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
+++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java
@@ -33,6 +33,8 @@ import com.plotsquared.core.util.ThreadUtils;
import com.plotsquared.core.util.task.TaskManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
@@ -62,6 +64,8 @@ import java.util.function.Function;
*/
public class UUIDPipeline {
+ private static final Logger logger = LoggerFactory.getLogger("P2/" + UUIDPipeline.class.getSimpleName());
+
private final Executor executor;
private final List serviceList;
private final List>> consumerList;
@@ -164,7 +168,7 @@ public class UUIDPipeline {
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
} catch (TimeoutException ignored) {
- PlotSquared.log(Captions.PREFIX + " (UUID) Request for " + username + " timed out");
+ logger.warn("[P2] (UUID) Request for {} timed out", username);
// This is completely valid, we just don't care anymore
}
return null;
@@ -187,7 +191,7 @@ public class UUIDPipeline {
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
} catch (TimeoutException ignored) {
- PlotSquared.log(Captions.PREFIX + " (UUID) Request for " + uuid + " timed out");
+ logger.warn("[P2] (UUID) Request for {} timed out", uuid);
// This is completely valid, we just don't care anymore
}
return null;
@@ -321,7 +325,7 @@ public class UUIDPipeline {
this.consume(mappings);
return mappings;
} else if (Settings.DEBUG) {
- PlotSquared.log("Failed to find all usernames");
+ logger.info("[P2] (UUID) Failed to find all usernames");
}
if (Settings.UUID.UNKNOWN_AS_DEFAULT) {
@@ -384,7 +388,7 @@ public class UUIDPipeline {
this.consume(mappings);
return mappings;
} else if (Settings.DEBUG) {
- PlotSquared.log("Failed to find all UUIDs");
+ logger.info("[P2] (UUID) Failed to find all UUIDs");
}
throw new ServiceError("End of pipeline");