Skip to content

feat: add /log-file support and enable DEBUG level when logging is requested - #932

Merged
PCMan merged 1 commit into
masterfrom
feature/launcher-debug-logging
Oct 17, 2026
Merged

PCMan merged 1 commit into
masterfrom
feature/launcher-debug-logging

Conversation

@PCMan

@PCMan PCMan commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Provides improved diagnostic capabilities for PIMELauncher by enabling DEBUG level tracing on demand and adding headless file logging via /log-file <path>, adhering strictly to Windows /flag conventions.

When neither /console nor /log-file is specified (normal background operation), all debug logging remains completely suppressed to std::io::sink with zero I/O overhead.

Key Changes

  • Dedicated LauncherArgs: Structured CLI parser strictly supporting Windows /flag style (/console, /log-file <PATH>, /log-file=<PATH>, /quit, /help, /?).
  • Enable DEBUG Level on /console: When running PIMELauncher.exe /console, the tracing subscriber max level is now set to Level::DEBUG (previously INFO), allowing developers to inspect RPC request/response details and backend routing in real time.
  • Support /log-file <path>:
    • Automatically creates parent directories if needed.
    • Can be used without /console to capture detailed debug logs in headless background mode.
  • Backend Input Tracing: Added tracing::debug!("Backend Input Raw: {:?}", data) in BackendManager to complement existing raw output logging.
  • Clean Helpers: Extracted setup_logging and open_log_file to keep main() concise, readable, and focused.
  • Help Message: Added /help and /? options to print available CLI options.
  • Unit Tests: Added unit tests in src/main.rs for LauncherArgs::parse.
  • Documentation: Updated HACKING.txt, README.md, and PIMELauncher/README.md with usage examples.

AI Declaration

Generated with assistance from Antigravity (Gemini 3.8 Flash).

… flag conventions

WHAT:
- Add structured Windows /flag parser supporting /console, /log-file <PATH>, /log-file=<PATH>, /quit, /help, and /?.
- Enable DEBUG level tracing subscriber when /console or /log-file is requested (suppressed in background mode to avoid GUI hangs).
- Use tracing_subscriber::registry() with composable layers for independent console (ANSI color) and log file (plain text) formatting.
- Add raw backend input logging in BackendManager to complement existing output tracing.
- Add unit tests for command line parsing in PIMELauncher/src/main.rs.
- Document debugging options in HACKING.txt, README.md, and PIMELauncher/README.md.

WHY:
- Developers and users diagnosing backend timeouts, crashes, or IPC issues need visibility into runtime behavior without GUI subsystem deadlocks.
- Following Windows /flag conventions maintains consistency with Windows system tools and installer scripts.

Generated with assistance from Antigravity
@PCMan
PCMan force-pushed the feature/launcher-debug-logging branch from 9b3c91c to e15c751 Compare October 17, 2026 07:10
@PCMan
PCMan merged commit fd7bc20 into master Oct 17, 2026
4 of 6 checks passed
@PCMan
PCMan deleted the feature/launcher-debug-logging branch October 18, 2026 20:36
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