Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log configuration mutes all exceptions encountered in the Minecraft task queue #26

Open
ILikePlayingGames opened this issue Feb 19, 2024 · 8 comments

Comments

@ILikePlayingGames
Copy link
Contributor

<RegexFilter regex="Error executing task.*|Unable to play unknown soundEvent.*" onMatch="DENY" onMismatch="NEUTRAL"/>

We should add narrower filtering to this. I encountered a scenario where some of my code running in the task queue failed silently and I discovered the exception was being muted by this

@ILikePlayingGames
Copy link
Contributor Author

Sample of a stack trace we want to block

[02:51:43] [main/FATAL] (Minecraft) Error executing task
 java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_402]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_402]
	at net.minecraft.util.Util.runTask(Util.java:34) [Util.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1004) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:439) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:100) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_402]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_402]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_402]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_402]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.NullPointerException
	at net.minecraft.scoreboard.Scoreboard.removeTeam(Scoreboard.java:262) ~[Scoreboard.class:?]
	at net.minecraft.client.network.NetHandlerPlayClient.handleTeams(NetHandlerPlayClient.java:1475) ~[NetHandlerPlayClient.class:?]
	at net.minecraft.network.play.server.S3EPacketTeams.processPacket(S3EPacketTeams.java:118) ~[S3EPacketTeams.class:?]
	at net.minecraft.network.play.server.S3EPacketTeams.processPacket(S3EPacketTeams.java:54) ~[S3EPacketTeams.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:13) ~[PacketThreadUtil$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_402]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[?:1.8.0_402]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:1.8.0_402]
	at net.minecraft.util.Util.runTask(Util.java:33) ~[Util.class:?]
	... 10 more

@ILikePlayingGames
Copy link
Contributor Author

Not possible to filter stack trace on log4j 2.0-beta9, functionality not implemented :(

https://github.com/apache/logging-log4j2/tree/log4j-2.0-beta9/log4j-core/src/main/java/org/apache/logging/log4j/core/filter

@ILikePlayingGames
Copy link
Contributor Author

Actually might be possible, idk if anyone wants to go through the effort to implement it though https://logging.apache.org/log4j/2.x/manual/plugins.html

@nea89o
Copy link
Owner

nea89o commented Feb 28, 2024

I think at that point a mod that just mixins into minecraft itself might be easier.

@ILikePlayingGames
Copy link
Contributor Author

I think if there was to be a mod, it would be good to have it available to users too.

@nea89o
Copy link
Owner

nea89o commented Feb 29, 2024

I think if there was to be a mod, it would be good to have it available to users too.

Do you mean a mod that can be used by end users too? I feel like having a developer focused mod would be nice too. There could be some specialized mixins for client dev like warning for client commands that don't overwrite canPlayerUseCommand or similar things as well.

@ILikePlayingGames
Copy link
Contributor Author

Yes, since Hypixel spams end user logs too. I thought about creating a dedicated dev tools mod but never had the time for it.

@ILikePlayingGames
Copy link
Contributor Author

There’s this plugin for IntelliJ https://github.com/marcin-bukowiecki/breakpoint-manager-plugin idk if there’s an existing gradle one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants