diff options
author | Keuin <[email protected]> | 2020-04-24 13:10:00 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2020-04-24 13:10:00 +0800 |
commit | 59674ed29c6b2c7e8ac98fc4f0f4fd4fd6d437c9 (patch) | |
tree | 47730fe93306b41b68f29b86ef5d0860c0d53d42 /src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | |
parent | 5749fc65909f0ee934d0410406265387157575a1 (diff) |
Implemented uniformed console output (log4j) in PrintUtil.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java index 47983b7..1f39266 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java +++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java @@ -3,12 +3,11 @@ package com.keuin.kbackupfabric; import com.keuin.kbackupfabric.data.BackupMetadata; import com.keuin.kbackupfabric.util.BackupFilesystemUtil; import com.keuin.kbackupfabric.util.BackupNameSuggestionProvider; +import com.keuin.kbackupfabric.util.PrintUtil; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.server.ServerStartCallback; import net.fabricmc.fabric.api.registry.CommandRegistry; import net.minecraft.server.MinecraftServer; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import java.io.File; import java.io.FileInputStream; @@ -25,18 +24,18 @@ import static org.apache.commons.io.FileUtils.forceDelete; */ public final class KBPluginEvents implements ModInitializer, ServerStartCallback { - private static final Logger LOGGER = LogManager.getLogger(); + //private static final Logger LOGGER = LogManager.getLogger(); @Override public void onInitialize() { - System.out.println("[KBackup] Binding events and commands ..."); + System.out.println("Binding events and commands ..."); CommandRegistry.INSTANCE.register(false, KBCommandRegister::registerCommands); ServerStartCallback.EVENT.register(this); } @Override public void onStartServer(MinecraftServer server) { - LOGGER.debug("[KBackup] Initializing ..."); + PrintUtil.debug("Initializing ..."); // Update backup suggestion list BackupNameSuggestionProvider.setBackupSaveDirectory(BackupFilesystemUtil.getBackupSaveDirectory(server).getPath()); @@ -55,9 +54,9 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback fileInputStream.close(); // Print metadata - LOGGER.info("[KBackup] Recovered from previous backup:"); - LOGGER.info("Backup Name: " + metadata.getBackupName()); - LOGGER.info("Create Time: " + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date(metadata.getBackupTime()))); + PrintUtil.info("Recovered from previous backup:"); + PrintUtil.info("Backup Name: " + metadata.getBackupName()); + PrintUtil.info("Create Time: " + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date(metadata.getBackupTime()))); // Delete metadata file if (!metadataFile.delete()) { |