summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-04-23 23:27:33 +0800
committerkeuin <[email protected]>2020-04-23 23:27:33 +0800
commitc0b2237a12fc878ede8a8bbd48c9b4afa8290016 (patch)
tree2dfdea3defb57b7974e4b8c4d6e14bd376fcaafd /src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java
parent36451c24439b6fc0a407b3aae12048125539f8d5 (diff)
Split Log4j
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java b/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java
index 0ca9015..57e59fb 100644
--- a/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java
+++ b/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java
@@ -8,6 +8,8 @@ import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.world.World;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
@@ -15,7 +17,6 @@ import java.util.HashMap;
import java.util.Map;
import static com.keuin.kbackupfabric.util.BackupFilesystemUtil.*;
-import static com.keuin.kbackupfabric.util.PrintUtil.debug;
import static com.keuin.kbackupfabric.util.PrintUtil.msgInfo;
/**
@@ -23,6 +24,8 @@ import static com.keuin.kbackupfabric.util.PrintUtil.msgInfo;
* To invoke this worker, simply call invoke() method.
*/
public final class BackupWorker implements Runnable {
+
+ private static final Logger LOGGER = LogManager.getLogger();
private final CommandContext<ServerCommandSource> context;
private final String backupName;
private final Map<World, Boolean> oldWorldsSavingDisabled;
@@ -53,9 +56,9 @@ public final class BackupWorker implements Runnable {
});
// Force to save all player data and worlds
- debug("Saving players ...");
+ LOGGER.debug("Saving players ...");
server.getPlayerManager().saveAllPlayerData();
- debug("Saving worlds ...");
+ LOGGER.debug("Saving worlds ...");
server.save(true, true, true);
// Start threaded worker
@@ -82,7 +85,7 @@ public final class BackupWorker implements Runnable {
// Make zip
String levelPath = getLevelPath(server);
String backupFileName = getBackupFileName(backupName);
- debug(String.format("zip(srcPath=%s, destPath=%s)", levelPath, backupSaveDirectoryFile.toString()));
+ LOGGER.debug(String.format("zip(srcPath=%s, destPath=%s)", levelPath, backupSaveDirectoryFile.toString()));
ZipUtil.makeBackupZip(levelPath, backupSaveDirectoryFile.toString(), backupFileName, backupMetadata);
File backupZipFile = new File(backupSaveDirectoryFile, backupFileName);