Bridge: report through the plugin logger, not System.out - #126
Merged
Conversation
Paper nags about it, and Paper is right:
Nag author(s): '[CaYaDev]' of 'MSMS-Bridge v1.0.0' about their usage of
System.out/err.print. Please use your plugin's logger instead.
A plugin writing to the raw stream bypasses the log file, the timestamps and
every appender the operator has configured. The transport is unchanged — the
server console is still how this reports, which is why installing it opens no
extra port — and the manager finds the line by its marker, which the logger's
own prefix leaves untouched.
`SelfTest` keeps its `System.out`: it is a harness that runs under plain `java`
and is excluded from the jar, so Paper never loads it.
Also: `build.mjs` no longer hardcodes the jar's version in its filename. It
reads it from `plugin.yml`, which is the file that defines it. The app finds the
jar by parsing that filename and the smoke asserts the shipped jar matches what
`plugin.yml` declares — two places to change is one place to forget, and the
failure is a plugin reporting a version it is not.
Bundled jar rebuilt at 1.0.1.
Going through the plugin logger means Paper prints the plugin name in front of every message. The plugin is `MSMS-Bridge`; the marker the parser looks for is `[MSMS-BRIDGE]`. Those differ only in case, and `parseBridgeLine` slices at the FIRST match — so if the two ever became the same string, every message would be cut at the wrong place and parse as nothing. Silently: no error, just a bridge that never reports. Asserted, tied to the two real sources rather than to a literal — the marker constant and the name in `plugin.yml` — plus a parse of a genuine logger-formatted line with the prefix in front of it.
Owner
Author
|
Self-review: the logger prefix is one rename from breaking the parser Going through the plugin logger means Paper prints the plugin name in front of Asserted, tied to the two real sources rather than to a literal — the marker |
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.
Bridge: report through the plugin logger, not System.out
Paper nags about it, and Paper is right:
A plugin writing to the raw stream bypasses the log file, the timestamps and
every appender the operator has configured. The transport is unchanged — the
server console is still how this reports, which is why installing it opens no
extra port — and the manager finds the line by its marker, which the logger's
own prefix leaves untouched.
SelfTestkeeps itsSystem.out: it is a harness that runs under plainjavaand is excluded from the jar, so Paper never loads it.
Also:
build.mjsno longer hardcodes the jar's version in its filename. Itreads it from
plugin.yml, which is the file that defines it. The app finds thejar by parsing that filename and the smoke asserts the shipped jar matches what
plugin.ymldeclares — two places to change is one place to forget, and thefailure is a plugin reporting a version it is not.
Bundled jar rebuilt at 1.0.1.