MinecraftTAS / TASmod

Minecraft Tool-Assisted Speedrun (TAS) Tools with input playback
https://discord.gg/jGhNxpd
GNU General Public License v3.0
30 stars 5 forks source link

Add logging markers #173

Closed ScribbleTAS closed 1 year ago

ScribbleTAS commented 1 year ago

Add a custom log4jconfig to the mod which allows markers, ansi-coloring and debug log level

Markers

Markers allow you to filter log messages later
To add a marker to log messages use:

TASmod.logger.info(LoggerMarkers.Event, "Message");

This message can then later be disabled with

-Dtasmod.marker.event=DENY

A new marker has to be added in the log4j.xml like this under <Filters>:

    <MarkerFilter marker="Event" onMatch="${sys:tasmod.marker.event:-ACCEPT}" onMismatch="NEUTRAL" />

TASmod log level

The TASmod logger now has a seperate log level from the regular fabric one.
It can be accessed with

-Dtasmod.log.level=INFO

Misc

Todo

Markers to be added:

Closes #154