play: the run's log in <data>\logs as well as on the console #670

Open
NotGomenesai wants to merge 1 commit from NotGomenesai/Darner:fix/play-log into post-merge
First-time contributor

darner play printed its log to the console only, while darner zip-logs looks for the run's log via DARNER_LOG_FILE or in <data>\logs (where only a failed start writes one). So a run started by hand, by a shortcut, or by a launcher that only reads the output gave a report zip with the crash logs alone. Cafe confirmed the file is never opened in play.rs and handed this over.

What it changes

  • New apps/darner/src/play_log.rs: at the start of play, the standard output and error go through a pipe; a thread copies each piece to the console (as before, UTF-16 to a console, bytes to a redirect) and into <data>\logs\darner-play-<date>-<time>-<pid>.log, colour codes left out, written as it comes so a crash loses nothing written before it.
  • DARNER_LOG_FILE is set to that file, so zip-logs (and the in-game zip) take it.
  • startup_error.rs: play_log() names the file with the existing log_file (now taking its prefix); the ten newest play logs kept, as for start errors.
  • Left out where DARNER_LOG_FILE is set already (whatever started the layer writes the log) or with DARNER_PLAY_LOG=0.

Tested (RTX 3070, Windows 11)

  • darner play with a missing exe: the error on the console and in a new darner-play-*.log.
  • A real start of the game to a closed window: 84 KB log from the first line to the last frame-time summary, no escape codes, the console as before, the process exits normally.

🤖 Generated with Claude Code

`darner play` printed its log to the console only, while `darner zip-logs` looks for the run's log via `DARNER_LOG_FILE` or in `<data>\logs` (where only a failed start writes one). So a run started by hand, by a shortcut, or by a launcher that only reads the output gave a report zip with the crash logs alone. Cafe confirmed the file is never opened in play.rs and handed this over. ## What it changes - New `apps/darner/src/play_log.rs`: at the start of `play`, the standard output and error go through a pipe; a thread copies each piece to the console (as before, UTF-16 to a console, bytes to a redirect) and into `<data>\logs\darner-play-<date>-<time>-<pid>.log`, colour codes left out, written as it comes so a crash loses nothing written before it. - `DARNER_LOG_FILE` is set to that file, so `zip-logs` (and the in-game zip) take it. - `startup_error.rs`: `play_log()` names the file with the existing `log_file` (now taking its prefix); the ten newest play logs kept, as for start errors. - Left out where `DARNER_LOG_FILE` is set already (whatever started the layer writes the log) or with `DARNER_PLAY_LOG=0`. ## Tested (RTX 3070, Windows 11) - `darner play` with a missing exe: the error on the console and in a new `darner-play-*.log`. - A real start of the game to a closed window: 84 KB log from the first line to the last frame-time summary, no escape codes, the console as before, the process exits normally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
darner play printed its log to the console only, while zip-logs looks for a run's log in <data>\logs, so a run started by hand or by a launcher that only reads the output left a zip with the crash logs alone. The standard output and error are now copied into <data>\logs\darner-play-<date>-<time>-<pid>.log (the ten newest kept, colour codes left out, written as it comes so a crash loses nothing before it), the console still showing everything, and DARNER_LOG_FILE names it for zip-logs. Left out where DARNER_LOG_FILE is set already or DARNER_PLAY_LOG=0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Note: this restores pre-merge's behaviour (v2026.12.04.01 play.rs named darner-play--

Note: this restores pre-merge's behaviour (v2026.12.04.01 play.rs named darner-play-<date>-<time>-<pid>.log in the logs folder, kept the ten newest and set DARNER_LOG_FILE); that part didn't come over in the merge.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/play-log:NotGomenesai-fix/play-log'
git switch 'NotGomenesai-fix/play-log'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'post-merge'
git merge --no-ff 'NotGomenesai-fix/play-log'
git switch 'NotGomenesai-fix/play-log'
git rebase 'post-merge'
git switch 'post-merge'
git merge --ff-only 'NotGomenesai-fix/play-log'
git switch 'NotGomenesai-fix/play-log'
git rebase 'post-merge'
git switch 'post-merge'
git merge --no-ff 'NotGomenesai-fix/play-log'
git switch 'post-merge'
git merge --squash 'NotGomenesai-fix/play-log'
git switch 'post-merge'
git merge --ff-only 'NotGomenesai-fix/play-log'
git switch 'post-merge'
git merge 'NotGomenesai-fix/play-log'
git push origin 'post-merge'
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
TrustNo1/Darner!670
No description provided.