Skip to content

Bridge: report through the plugin logger, not System.out - #126

Merged
CaYatur merged 2 commits into
mainfrom
fix/bridge-logger
Jul 29, 2026
Merged

Bridge: report through the plugin logger, not System.out#126
CaYatur merged 2 commits into
mainfrom
fix/bridge-logger

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Bridge: report through the plugin logger, not System.out

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.

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.
Copilot AI review requested due to automatic review settings July 29, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.
@CaYatur

CaYatur commented Jul 29, 2026

Copy link
Copy Markdown
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
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.

@CaYatur
CaYatur merged commit 137491a into main Jul 29, 2026
1 check passed
@CaYatur
CaYatur deleted the fix/bridge-logger branch July 29, 2026 00:39
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.

2 participants