Skip to content

fix: route dependency logs through plugin logger instead of System.err#1059

Merged
confuser merged 2 commits intomasterfrom
fix/stderr-logging
Apr 3, 2026
Merged

fix: route dependency logs through plugin logger instead of System.err#1059
confuser merged 2 commits intomasterfrom
fix/stderr-logging

Conversation

@confuser
Copy link
Copy Markdown
Member

@confuser confuser commented Apr 3, 2026

Replace the shaded slf4j-simple binding (which writes to System.err) with a custom SLF4J 1.7.x binding that routes HikariCP and ORMLite log output through the plugin's CommonLogger on Bukkit. This eliminates the Paper/Spigot nag: "Please use your plugin's logger instead".

  • Swap slf4j-simple for slf4j-api in bukkit module
  • Add custom SLF4J binding (StaticLoggerBinder, BanManagerLoggerFactory, BanManagerSlf4jLogger) under org.slf4j.impl for Shadow relocation
  • Implement log level filtering in BanManagerSlf4jLogger (suppress TRACE/DEBUG/INFO unless debug mode is on)
  • Add severe(String, Throwable) and warning(String, Throwable) default methods to CommonLogger interface
  • Override with native logging in all 6 platform PluginLogger classes
  • Replace all ~220 e.printStackTrace() calls across common and platform modules with proper logger.warning()/logger.severe() calls
  • Add unit tests for CommonLogger methods and stderr regression test
  • Add E2E test verifying absence of Paper nag and [STDERR] lines

Closes #1050

confuser added 2 commits April 3, 2026 20:45
#1050)

Replace the shaded slf4j-simple binding (which writes to System.err) with a
custom SLF4J 1.7.x binding that routes HikariCP and ORMLite log output through
the plugin's CommonLogger on Bukkit. This eliminates the Paper/Spigot nag:
"Please use your plugin's logger instead".

- Swap slf4j-simple for slf4j-api in bukkit module
- Add custom SLF4J binding (StaticLoggerBinder, BanManagerLoggerFactory,
  BanManagerSlf4jLogger) under org.slf4j.impl for Shadow relocation
- Implement log level filtering in BanManagerSlf4jLogger (suppress
  TRACE/DEBUG/INFO unless debug mode is on)
- Add severe(String, Throwable) and warning(String, Throwable) default
  methods to CommonLogger interface
- Override with native logging in all 6 platform PluginLogger classes
- Replace all ~220 e.printStackTrace() calls across common and platform
  modules with proper logger.warning()/logger.severe() calls
- Add unit tests for CommonLogger methods and stderr regression test
- Add E2E test verifying absence of Paper nag and [STDERR] lines

Closes #1050
…gger

- Add ReloadListener for Sponge API 11+ to re-register chat listener on
  bmreload, matching Bukkit/Bungee/Velocity/Sponge-API7 (missing since #1022)
- Pass Throwable through in BanManagerSlf4jLogger trace/debug/info methods
  instead of silently dropping it when debug mode is enabled
- Remove duplicate log line in Sponge JoinListener
@confuser confuser merged commit 837f85c into master Apr 3, 2026
18 checks passed
@confuser confuser deleted the fix/stderr-logging branch April 3, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please use your plugin's logger instead

1 participant