介绍
Log Filter
Filters configured messages from the log and console in a performant way.
This is intended to be used by pack creators. Consider NOT send modified logs to mod creators if you’re reporting bugs.
Usage
Below is a commented config file ("log_filter.json") to remove all logging of datapack loading failure. This can be useful if a datapack removes recipes by e.g. replacing them with empty files. To use this, you need to remove the comments! The CF page render seems to have a problem with code blocks, so paste it into a editor that supports json formatting I guess.
{
"logEvents": "NONE", //Setting this to "INFO" will change ALL messages logged into a format useful to configure this mod (see below)
"rules": [ // Array of rules. If a rule matches, the message will not be logged
{
"level": [ // Array of levels. These are combined by AND within a rule.
{
"relation": "EQUAL", // Relation (Supports EQUAL, NOT_EQUAL, GREATER_THAN, etc.)
"value": "ERROR" // Value must be a valid level
}
],
"loggerName": [ // Array of logger names
{
"relation": "MATCH", // Relation
"value": "net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener" // Class
}
],
"formatMessage": [ // The message with formatting not applied (with the placeholders instead of values)
{
"relation": "MATCH",
"value": "Couldn't parse data file {} from {}"
}
],
"parameterClasses": [ // Types of parameters/placeholders
{
"0": { // First placeholder
"relation": "MATCH",
"value": "net.minecraft.resources.ResourceLocation"
},
"1": { // Second placeholder
"relation": "MATCH",
"value": "net.minecraft.resources.ResourceLocation"
},
"2": { // Etc.
"relation": "MATCH",
"value": "com.google.gson.JsonParseException"
}
}
]
}
]
}
If "logEvents" is set, all log messages will be transformed:
[20:18:10] [modloading-worker-0/INFO] [Log Filter/]: Logging event:
- Level: INFO
- Logger name: mezz.jei.library.load.PluginCaller
- Thread name: modloading-worker-0
- Throwable class: null
- Message: Sending ConfigManager...
- Format message: {}...
- Parameter classes: [java.lang.String]
常见问题
Log Filter 支持哪些 Minecraft 版本?
Log Filter 支持 Minecraft Java 版 1.21–1.21.1,共 2 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
Log Filter 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Nick1st_ 的其他作品
查看全部 →FancyVideo-API
用于在 Minecraft 中渲染视频的 API
Immersive Portal Gun
利用 Immersive Portals 的功能实现的传送枪
LCPatches
修复《1.12.2 Lost Cities》模组的一些问题的核心模组。
MiniScaled
带上你的小世界一起出发。
评论
登录后评论和评分