Skip to content

Add plugin: server_log_filter - #650

Merged
alex3236 merged 2 commits into
MCDReforged:masterfrom
Pau1am:add-server_log_filter
Oct 2, 2026
Merged

alex3236 merged 2 commits into
MCDReforged:masterfrom
Pau1am:add-server_log_filter

Conversation

@Pau1am

@Pau1am Pau1am commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

新增插件 server_log_filter,由作者本人提交。

插件作用:用一个可配置的正则规则列表,把服务端的刷屏日志从 MCDR 控制台隐去,同时完整保留服务端自己的日志文件。

默认内置一条规则,用于屏蔽 Minecraft 26.3「幽灵方块」自动修复机制的误报刷屏(Mojira MC-311474 / MC-311727,玩家正常跳跃和移动时也会触发,每人每 10 秒最多一条):

Player <名字> standing on air - force-sending blocks below

设计上的关键点:使用 InfoActionFlag.hidden() 而非 discarded(),因此匹配到的行仍会正常派发给 MCDR 的信息响应器与插件事件。即使规则写得过于宽泛,也不会破坏 MCDR 自身的「服务端启动 / 停止 / 玩家进出」检测——最坏情况只是控制台上看不到这一行。

本地已验证:

  • 单元测试覆盖过滤逻辑、边界输入与非法正则容错,并逐一确认 11 类关键日志行(启动完成 / 玩家进出 / Stopping the server / moved too quickly / moved wrongly 等)不受影响
  • 在 MCDR 2.15.7 上实测加载与过滤功能正常,服务端日志文件不受影响

An MCDReforged plugin that hides noisy server console lines from the MCDR
console with configurable regex rules, while leaving the server's own log
file untouched.

It uses InfoActionFlag.hidden() rather than discarding the info, so matched
lines are still dispatched to MCDR's info reactors and plugin events. An
overly broad rule therefore cannot break MCDR's own server startup / stop /
player join-leave detection -- the worst case is that the line is not echoed
to the console.

Repository: https://github.com/Pau1am/MCDR-ServerLogFilter
Release:    ServerLogFilter-v1.0.1.mcdr (MCDR >= 2.13.0)
@github-actions github-actions Bot added the plugins Plugin modifications label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution! 🎉
Please be patient before we done checking. If you've added or modified plugins, a brief report will be generated below.
Have a nice day!

# 合并前检查单(供仓库维护者参考)
- *插件适合提交;
- 提交者有权提交;
- 所提交信息完整有效;
- 插件分类正确,名称、介绍和说明符合要求。
详见贡献指南

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Last updated at: 2026-10-02 16:52:49 (UTC+8)
Add label recheck to regenerate manually

Plugin Validation Report

➕ server_log_filter

Info Value Valid
URL Pau1am/MCDR-ServerLogFilter@main ✅
Authors Pau1am -
License MIT ✅
Labels Management -
Introduction en_us zh_cn ✅
Meta mcdreforged.plugin.json ✅
Latest Release 1.0.2 ✅
Meta Value
Name Server Log Filter
Version 1.0.2
Authors Pau1am
Description en_us Hide noisy server console lines from the MCDR console with configurable regex rules, without touching the server's own log file.
zh_cn 用可配置的正则规则,把服务端的刷屏日志从 MCDR 控制台隐去,同时不影响服务端自身的日志文件。

Co-authored-by: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com>
@alex3236

alex3236 commented Oct 2, 2026

Copy link
Copy Markdown
Member

其实这玩意还是装 mod 效率高,让 MCDR 处理再咋样也会有性能损耗的

@alex3236
alex3236 merged commit 5c7bdfc into MCDReforged:master Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins Plugin modifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants