Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Log4J xml-spam has been an issue since the l4j RCE exploit was discovered a while ago. It makes reading logs at runtime harder, if not impossible, for end-users and makes modpack development take longer unnecessarily.
Approach
I'm parsing the raw XML log4j spits out through string manipulation. It's not the most elegant (or fastest) solution, but we're already using console.log, so speed went out the window a while ago, and I don't know nearly enough about regex to use it in a production setting. Future revisions could clean this up, but for now it's functional.
I very specifically decided not to parse messages coming through stderr, because if you're reading error messages you probably know how to sift through xml anyways.
Open Questions and Pre-Merge TODOs
Learning
All of this was done from memory, it's very simple Vanilla JS. I did the bulk of development in the Electron dev tools, rather than in an actual development environment, because I wasn't originally planning on doing a PR, then decided other people would probably benefit from having this tiny tweak.
In the future, I might do an additional PR to clean this up using regex rather than string manipulation, which would involve much more learning, as I don't know nearly enough regex to do something like this.