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/util | |
parent | 5749fc65909f0ee934d0410406265387157575a1 (diff) |
Implemented uniformed console output (log4j) in PrintUtil.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java index fe98cfa..ca00ad4 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java @@ -6,6 +6,9 @@ import net.minecraft.text.LiteralText; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + public final class PrintUtil { @@ -15,6 +18,7 @@ public final class PrintUtil { private static final Style warnStyle = new Style().setColor(Formatting.YELLOW); private static final Style errorStyle = new Style().setColor(Formatting.DARK_RED); + private static final Logger LOGGER = LogManager.getLogger(); public static CommandContext<ServerCommandSource> msgInfo(CommandContext<ServerCommandSource> context, String messageText) { return msgInfo(context, messageText, false); @@ -48,4 +52,20 @@ public final class PrintUtil { } return context; } + + public static void debug(String string) { + LOGGER.debug("[KBackup] " + string); + } + + public static void info(String string) { + LOGGER.info("[KBackup] " + string); + } + + public static void warn(String string) { + LOGGER.warn("[KBackup] " + string); + } + + public static void error(String string) { + LOGGER.error("[KBackup] " + string); + } } |