summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBCommands.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/KBCommands.java
parent36451c24439b6fc0a407b3aae12048125539f8d5 (diff)
Split Log4j
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBCommands.java6
1 files changed, 5 insertions, 1 deletions
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<Integer, String> 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);