Open
Conversation
Author
|
CI失败与我的代码修改无关,是GitHub Actions工作流配置问题。错误显示找不到名为"Download"的artifact,这属于CI流程问题,不影响代码本身的正确性。 |
Author
|
希望合并一下,因为我现在在用MySQL,每次都会冒出这个提示看得我有点心慌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
本次 PR 旨在优化 AuthMe 插件加载过程中 MySQL 数据库连接的日志输出,解决由 HikariCP 库引起的不规范日志行为。
优化之前:
优化之后:
优化原因:
消除 Spigot/Paper 的 "Nag author" 警告:
优化前,HikariCP 内部使用的 SLF4J (SimpleLogger) 默认将日志输出到
System.err(标准错误流)。在 Bukkit/Spigot 环境下,这会触发服务器的监控机制,产生“Nag author”警告,提示开发者不应直接使用System.out/err,而是应该使用插件自带的Logger。本次修改成功消除了这一警告,提升了插件的兼容性和专业形象。修复日志级别误报:
优化前,HikariCP 的
INFO级别日志(如Starting...和Start completed.)被非规范地重定向到了STDERR,导致服务器控制台将其错误地标记为[ERROR]。本次修改纠正了这一问题,使这些信息以正确的[INFO]级别显示,避免了服主对数据库连接状态产生误解。提升日志规范性 (部分实现):
根据 Bukkit 插件开发规范,所有输出应通过
java.util.logging.Logger进行。本次修改通过设置系统属性fr.xephi.authme.libs.org.slf4j.simpleLogger.defaultLogLevel为warn,成功阻止了第三方库通过System.err进行的非规范输出。此外,AuthMe 自身关于数据库连接的重要提示现在通过插件的ConsoleLogger正确记录,避免了对System.out/err的直接使用。虽然部分 HikariCP 内部的INFO级别日志仍然存在,但最严重的违规行为已得到解决。显著提升控制台信息清晰度:
本次优化彻底移除了服务器对非规范日志产生的
[ERROR]和[WARN]标记,使控制台输出不再出现误报的错误信息和烦人的“Nag author”警告。这使得启动日志更加干净、易于理解和排查,为服主提供了更良好的使用体验。