From c0b2237a12fc878ede8a8bbd48c9b4afa8290016 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 23 Apr 2020 23:27:33 +0800 Subject: Split Log4j --- src/main/java/com/keuin/kbackupfabric/KBCommands.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommands.java b/src/main/java/com/keuin/kbackupfabric/KBCommands.java index 825046d..b93a5c9 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBCommands.java +++ b/src/main/java/com/keuin/kbackupfabric/KBCommands.java @@ -8,6 +8,8 @@ import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.context.CommandContext; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.File; import java.time.LocalDateTime; @@ -23,6 +25,7 @@ public final class KBCommands { private static final int SUCCESS = 1; private static final int FAILED = -1; + private static final Logger LOGGER = LogManager.getLogger(); private static final HashMap backupIndexNameMapper = new HashMap<>(); // index -> backupName private static String restoreBackupNameToBeConfirmed = null; @@ -144,6 +147,7 @@ public final class KBCommands { // Do backup BackupMetadata metadata = new BackupMetadata(System.currentTimeMillis(), backupName); + LOGGER.info("Invoking backup worker ..."); BackupWorker.invoke(context, backupName, metadata); return SUCCESS; } @@ -167,7 +171,7 @@ public final class KBCommands { // Get server MinecraftServer server = context.getSource().getMinecraftServer(); String backupFileName = getBackupFileName(backupName); - debug("Backup file name: " + backupFileName); + LOGGER.debug("Backup file name: " + backupFileName); File backupFile = new File(getBackupSaveDirectory(server), backupFileName); PrintUtil.msgInfo(context, "Server will shutdown in a few seconds, depended on your world size and the disk speed, the restore progress may take seconds or minutes.", true); -- cgit v1.2.3