Skip to content

Replace System.err with file-backed AppLogger across all service layers#5

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-copilot-instructions
Open

Replace System.err with file-backed AppLogger across all service layers#5
Copilot wants to merge 2 commits intomainfrom
copilot/update-copilot-instructions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

Windows jpackage installs run as a pure GUI process — no console, so all System.err/System.out output is silently dropped. Every unhandled exception in the service layer killed the app with zero user feedback.

Changes

  • util/AppLogger (new): single static logger writing timestamped entries to both stderr and ~/.namegame/namegame.log (fallback: %TEMP%\namegame.log). Call init(Path) once at startup; use log(String) / log(String, Throwable) everywhere else.

  • NameGameApplication: removed duplicated logging fields/methods; delegates to AppLogger. main() calls AppLogger.init() before any service is instantiated or the FX toolkit is launched.

  • SoundService, ImageService, RosterService, MappingService, StatisticsService: all System.err.println() / System.out.println() calls replaced with AppLogger.log().

  • .github/copilot-instructions.md: added Logging and Error Handling sections codifying AppLogger as the required pattern and explicitly prohibiting direct console output.

// Before (silently lost in GUI installs)
System.err.println("Failed to load roster: " + e.getMessage());

// After (written to ~/.namegame/namegame.log regardless of console)
AppLogger.log("Failed to load roster: " + rosterFile, e);
Original prompt

Try again

The user has attached the following file paths as relevant context:

  • .github\copilot-instructions.md

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…tions

Co-authored-by: mrobbeloth <7305208+mrobbeloth@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Copilot instructions in documentation Replace System.err with file-backed AppLogger across all service layers Mar 4, 2026
@mrobbeloth mrobbeloth marked this pull request as ready for review March 28, 2026 22:39
@mrobbeloth mrobbeloth self-requested a review as a code owner March 28, 2026 22: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