aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrady <thatgravyboat@gmail.com>2024-05-24 12:14:58 -0230
committerGitHub <noreply@github.com>2024-05-24 16:44:58 +0200
commitb9104901196ff4139cbcd9e77a30e733b99cf407 (patch)
tree9a5a5c579dd01fdd85933a4c49b7ab5d6ce20873 /src
parent071d36051c937b0ca82d3e3aeee8f212db1e2ef6 (diff)
downloadskyhanni-b9104901196ff4139cbcd9e77a30e733b99cf407.tar.gz
skyhanni-b9104901196ff4139cbcd9e77a30e733b99cf407.tar.bz2
skyhanni-b9104901196ff4139cbcd9e77a30e733b99cf407.zip
Backend: MinecraftConsoleFilter not extending AbstractFilter (#1877)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt17
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?,