diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index 4022b382c..5b6d9e8c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -11,9 +11,13 @@ import org.apache.logging.log4j.core.Filter import org.apache.logging.log4j.core.LogEvent import org.apache.logging.log4j.core.Logger import org.apache.logging.log4j.core.LoggerContext +import org.apache.logging.log4j.core.filter.AbstractFilter import org.apache.logging.log4j.message.Message -class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { +class MinecraftConsoleFilter(private val loggerConfigName: String) : AbstractFilter( + /* onMatch = */ Filter.Result.ACCEPT, + /* onMismatch = */ Filter.Result.DENY, +) { private val config get() = SkyHanniMod.feature.dev.minecraftConsoles private val filterConfig get() = config.consoleFilter @@ -35,9 +39,6 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { } } - // prevents error sending on every shutdown - fun stop() {} - override fun filter(event: LogEvent?): Filter.Result { if (event == null) return Filter.Result.ACCEPT @@ -205,14 +206,6 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : Filter { } } - override fun getOnMismatch(): Filter.Result { - return Filter.Result.DENY - } - - override fun getOnMatch(): Filter.Result { - return Filter.Result.ACCEPT - } - override fun filter( logger: Logger?, level: Level?, |