Skip to content

Skip empty logs when picking a game's crash log - #588

Open
thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-empty-log-hides-game-output
Open

thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-empty-log-hides-game-output

Conversation

@thehobbit85

Copy link
Copy Markdown
Contributor

What this changes

Refs #356.

To show why a game closed, the launcher picks the newest log from the game's folder, and falls back to what the game printed, then to ReShade's log. The folder walk took any .log touched since the game started, including an empty one. A game that makes its log at start and crashes before writing to it leaves an empty file, and that file won over what the game printed. The crash window, Report on GitHub, website reports and Export Logs then showed an empty log, as in the "Last 1 lines of game.log" with nothing under it in #356.

Empty files are now passed over in the folder walk and the ReShade fallback, as they already were for the game's printed output.

Limits: a log that only has blank lines in it still counts. I can't confirm this is what happened in #356, only that its report matches it.

How you tested it

Run on macOS against eaf7ca2, with synthetic logs.

  • New test: an empty game.log beside printed output. On main the empty log was picked; with this change the printed output is.

  • Control test: a game.log with lines in it is still picked over the printed output.

  • Rust: 1,217 passed, 1 ignored. UI: 1,019 passed, 11 skipped. git diff --check clean.

  • npm test passes

  • node --test tests/*.test.cjs passes

  • Tried it in the launcher (npm run dev)

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • Does not change what developers can write in recomplauncher.json

A game that makes its log at start and crashes before writing to it left an empty .log file, and that file was picked as the crash log over what the game printed. The crash window, reports and logs then showed nothing. Empty logs are now passed over, as the game's printed output already was.
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