Skip to content

Logging levels, process output and diagnostics for the MPF engine - #50

Merged
freezy merged 2 commits into
masterfrom
feat/error-reporting
Oct 15, 2026
Merged

freezy merged 2 commits into
masterfrom
feat/error-reporting

Conversation

@freezy

@freezy freezy commented Oct 15, 2026

Copy link
Copy Markdown
Member

Part of the logging and error reporting work. It follows the level policy from freezy/VisualPinball.Engine#590: errors are for VPE bugs, and problems the user or table author can fix are warnings. What the plugin knows goes into the session diagnostics that error reports carry.

  • Unknown switch, coil and lamp numbers are warnings, once per number.
  • MPF's stdout and stderr are always read when redirected (a full pipe could block MPF) and logged as "Mpf.Process", stderr by its own level.
  • Startup failures say which step failed and where MPF's log is, and are reported through IGamelogicStartupStatus; rethrows keep their stack trace.
  • The engine describes itself for error reports: MPF version, executable, machine folder, output mode, BCP state, settings.

Depends on freezy/VisualPinball.Engine#590 (the plugin API: IPluginLog, IDiagnosticsSource, IGamelogicStartupStatus), so merge that first.

- Unknown switch, coil and lamp numbers are warnings, once per number.
- MPF's stdout and stderr are always read when redirected (a full pipe could
  block MPF) and logged as "Mpf.Process", stderr by its own level.
- Startup failures say which step failed and where MPF's log is, and are
  reported through IGamelogicStartupStatus; rethrows keep their stack trace.
- The engine describes itself for error reports: MPF version, executable,
  machine folder, output mode, BCP state, settings.
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge after its stated plugin API dependency.

Summary

Adds clearer MPF logs and session diagnostics.

  • MPF startup and process output now come with clearer details.
  • MPF diagnostics now show the state and details behind a mismatch.
  • Missing mappings and unknown MPF commands now get focused warnings.
  • The included BCP media controller now explains connection and message problems.

Both previous findings are fixed. No new issues were found in the changes since the previous review.

Reviews (2) · Last reviewed commit: "logging: Keep warnings per table and ign..." · Reviewed by Greptile

Comment thread Runtime/MpfGamelogicEngine.cs Outdated
Comment thread Runtime/MpfWrangler.cs Outdated
…t code.

The once-per-number warnings belong to the engine instance. When MPF was
started through a terminal launcher, the exit code is the launcher's, so
it's no longer reported as MPF's.
@freezy
freezy merged commit d5725d4 into master Oct 15, 2026
5 checks passed
@freezy
freezy deleted the feat/error-reporting branch October 15, 2026 19:23
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.

1 participant