From 59674ed29c6b2c7e8ac98fc4f0f4fd4fd6d437c9 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 24 Apr 2020 13:10:00 +0800 Subject: Implemented uniformed console output (log4j) in PrintUtil. --- .../java/com/keuin/kbackupfabric/worker/BackupWorker.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java') diff --git a/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java b/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java index 3303f70..675d183 100644 --- a/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java +++ b/src/main/java/com/keuin/kbackupfabric/worker/BackupWorker.java @@ -8,8 +8,6 @@ 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; @@ -25,7 +23,7 @@ import static com.keuin.kbackupfabric.util.PrintUtil.msgInfo; */ public final class BackupWorker implements Runnable { - private static final Logger LOGGER = LogManager.getLogger(); + //private static final Logger LOGGER = LogManager.getLogger(); private final CommandContext context; private final String backupName; private final Map oldWorldsSavingDisabled; @@ -56,9 +54,9 @@ public final class BackupWorker implements Runnable { }); // Force to save all player data and worlds - LOGGER.info("Saving players ..."); + PrintUtil.info("Saving players ..."); server.getPlayerManager().saveAllPlayerData(); - LOGGER.info("Saving worlds ..."); + PrintUtil.info("Saving worlds ..."); server.save(true, true, true); // Start threaded worker @@ -85,8 +83,8 @@ public final class BackupWorker implements Runnable { // Make zip String levelPath = getLevelPath(server); String backupFileName = getBackupFileName(backupName); - LOGGER.debug(String.format("zip(srcPath=%s, destPath=%s)", levelPath, backupSaveDirectoryFile.toString())); - LOGGER.info("Compressing level ..."); + PrintUtil.debug(String.format("zip(srcPath=%s, destPath=%s)", levelPath, backupSaveDirectoryFile.toString())); + PrintUtil.info("Compressing level ..."); ZipUtil.makeBackupZip(levelPath, backupSaveDirectoryFile.toString(), backupFileName, backupMetadata); File backupZipFile = new File(backupSaveDirectoryFile, backupFileName); -- cgit v1.2.3