aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt b/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
new file mode 100644
index 0000000..72a641a
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
@@ -0,0 +1,18 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+package moe.nea.firmament.features.debug
+
+import net.minecraft.text.Text
+import moe.nea.firmament.util.MC
+
+class DebugLogger(val tag: String) {
+ fun isEnabled() = DeveloperFeatures.isEnabled // TODO: allow filtering by tag
+ fun log(text: () -> String) {
+ if (!isEnabled()) return
+ MC.sendChat(Text.literal(text()))
+ }
+}