Fix #4240: 旧版MC日志把每一条都给算成error#6304
Conversation
|
艹,竟然有人想起来这条issue |
|
你能给一个所有日志都被算为error的一个版本范围吗 |
|
update:上面评论所有的版本都解决了,可以随时审查合并 |
| } | ||
|
|
||
| private static boolean containsLevelMarker(String line, Level level) { | ||
| return line.contains("[" + level.getName() + "]") |
There was a problem hiding this comment.
这个方法是需要在后台对每一条日志都要调用的,不要在这里高频拼接字符串造成内存分配。
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the log level guessing logic in Log4jLevel.java by introducing helper methods and predefined marker arrays to simplify the parsing code. It also updates LauncherHelper.java to leverage these new methods. The review identified two critical issues: first, redundant calls to guessLevel in LauncherHelper.java that degrade performance and can lead to a potential NullPointerException when level remains null; second, a regression in Log4jLevel.java where the check for [STDERR] was omitted during the refactoring of error markers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.






update:下面评论所有的版本都解决了
Close #4240
老版本日志的级别都是本地化中文的,所以还需要根据这个判断日志级别,不能不改Log4jLevel.java,否则全部日志都会变成信息级别