aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
blob: 72a641af4d788f669204d7b981d54ed90a7039b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()))
    }
}