fix(problems): the crash check reads the game log in logs/ too #60

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/crash-check-logs into main 2026-11-14 05:25:31 +00:00
Owner

On builds from Longshot nightly-127 on, the launcher never says that the game closed unexpectedly: the game's log moved to logs/longshot_log.txt (MagicBeanDev/Longshot#321), and the crash check only reads longshot_log.txt beside the game.

What changed

  • Core/Problems.cs: CrashCheck.LogPath returns the newer of logs/longshot_log.txt and the loose longshot_log.txt, and CrashCheck.Find reads that one. Both places are kept, since Longshot v3.0.0-rc.3 and the nightlies before 127 still write the loose file.
    • The game moves a loose log into logs/ at its first start, but keeps it where it is when one of that name is there already (host/game_layout.c). That's why it takes the newer file rather than preferring logs/.
    • When a build from before ran last, its loose log is newer, so the check reads that run's log.
  • tests/launcher_core/ProblemChecks.cs: the crash check's test now also covers:
    • a crash log in logs/ is found;
    • with both files there, logs/ is read when it is newer;
    • a newer loose log from a clean run is read instead, and nothing is offered.

How it was tested

  • I checked by reading the code, on both sides, that the game writes its log to <game folder>/logs/longshot_log.txt, with the same game folder the launcher already uses: Longshot host/game_layout.c and host/hos_main.c at cf605c85, against host/hos_main.c at 0c74253d (v3.0.0-rc.3).
  • No tests were run on my PC, not even this one, so python -I tests/test_launcher_core.py and python -I tests/test_release.py are left to CI.
  • Not tried in the launcher against a crashed nightly-127 build.

Found while checking whether a new launcher nightly needs a new builder release. It needs none: everything else the launcher reads from a build is unchanged by the layout move.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn

On builds from Longshot nightly-127 on, the launcher never says that the game closed unexpectedly: the game's log moved to `logs/longshot_log.txt` (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/321), and the crash check only reads `longshot_log.txt` beside the game. ## What changed - `Core/Problems.cs`: `CrashCheck.LogPath` returns the newer of `logs/longshot_log.txt` and the loose `longshot_log.txt`, and `CrashCheck.Find` reads that one. Both places are kept, since Longshot v3.0.0-rc.3 and the nightlies before 127 still write the loose file. - The game moves a loose log into `logs/` at its first start, but keeps it where it is when one of that name is there already (`host/game_layout.c`). That's why it takes the newer file rather than preferring `logs/`. - When a build from before ran last, its loose log is newer, so the check reads that run's log. - `tests/launcher_core/ProblemChecks.cs`: the crash check's test now also covers: - a crash log in `logs/` is found; - with both files there, `logs/` is read when it is newer; - a newer loose log from a clean run is read instead, and nothing is offered. ## How it was tested - I checked by reading the code, on both sides, that the game writes its log to `<game folder>/logs/longshot_log.txt`, with the same game folder the launcher already uses: Longshot `host/game_layout.c` and `host/hos_main.c` at cf605c85, against `host/hos_main.c` at 0c74253d (v3.0.0-rc.3). - **No tests were run on my PC**, not even this one, so `python -I tests/test_launcher_core.py` and `python -I tests/test_release.py` are left to CI. - Not tried in the launcher against a crashed nightly-127 build. Found while checking whether a new launcher nightly needs a new builder release. It needs none: everything else the launcher reads from a build is unchanged by the layout move. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn
fix(problems): the crash check reads the game's log in logs/ too
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 2s
255e0dc201
Longshot's game folder layout (MagicBeanDev/Longshot #321, in nightly-127 and later) writes the
game's log to logs/longshot_log.txt and moves a loose one there at the first start. The crash
check read only longshot_log.txt beside the game, so on those builds a crash was never offered.
It now reads the newer of logs/longshot_log.txt and the loose file (builds from before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn
HumanBean deleted branch fix/crash-check-logs 2026-11-14 05:25:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!60
No description provided.