-
Notifications
You must be signed in to change notification settings - Fork 4
13 logging and debug
drpetersonfernandes edited this page Aug 6, 2026
·
1 revision
Serilog setup, sinks, the Debug Window, and bug-reporting. Related: 04 — Architecture · 08 — UI Layer
Serilog 4.4.0 (+ Serilog.Sinks.Async 2.1.0, Serilog.Sinks.Debug 3.0.0, Serilog.Sinks.File 7.0.0) is configured in App.OnStartup (App.xaml.cs:117-137):
-
File sink: rolling daily file in the local app-data folder (
%LocalAppData%\SimpleLauncher\error_user.logby default, orLogPathoverride), 7 days retained. -
DebugWindowSink: pushes log events to the live Debug Window (buffered; flushed when the window connects). -
BugReportApiSink: queues events for the bug-report API (see below). - Fallback: if Serilog initialization fails, the app falls back to debug output instead of crashing.
ILogger (Serilog) is injected everywhere — Core and app projects both have a global using Serilog; (see 02 — Projects & Solution).
-
DebugWindow(app): singleton live log viewer; closing hides the window instead of destroying it; logging continues; reopening flushes the buffered history. - Launched via the tray menu / Help menu, or automatically with the
-debugcommand-line flag (opens alongside the main window). -
IDebugLogger(legacy abstraction) andNoOpDebugLogger(fallback) still exist for compatibility; new code uses SerilogILoggerdirectly.
BugReportApiSink (SimpleLauncher.Core\Services\DebugAndBugReport\BugReportApiSink.cs):
- Log events are queued (bounded — warnings do not grow unbounded, ~100-cap) and submitted to the bug-report API.
- On success: queued logs are deleted.
- On failure:
critical_error.log(orerror.log/error_user.log) is written locally with environment details;WindowsVersionService/GetMicrosoftWindowsVersionsupply OS info for reports.
The Support Window (SupportWindow + SupportViewModel) is the user-facing entry point: name/email/message validation, "Sending support request…" overlay, POST to the support API, and an emergency return button on the overlay.
| Path | Content |
|---|---|
%LocalAppData%\SimpleLauncher\error_user.log |
rolling daily log (7 days) |
%LocalAppData%\SimpleLauncher\error.log |
error-level log |
%LocalAppData%\SimpleLauncher\critical_error.log |
written when the bug-report API is unreachable |
| Debug Window (in-app) | live stream via DebugWindowSink
|
- 04 — Architecture (startup sequence)
- 08 — UI Layer (Debug Window, status bar)
- 14 — Testing (log-related tests)
- Home
- 01 Overview
- 02 Projects And Solution
- 03 Quickstart
- 04 Architecture
- 05 Configuration
- 06 Systems And Launch
- 07 Core Services
- 08 Ui Layer
- 09 Retroachievements
- 10 Game Scanning
- 11 Bundled Tools
- 12 Data Formats
- 13 Logging And Debug
- 14 Testing
- 15 Development
- 16 Updater
- 17 Release Notes
- 18 Emulator Parameters
- Manual Tests
- Parameters