Skip to content

log to per-process files, and make crash reports easier to collect (partial #73) - #401

Open
skryvel wants to merge 4 commits into
Supreeeme:mainfrom
skryvel:logging-improvements
Open

log to per-process files, and make crash reports easier to collect (partial #73)#401
skryvel wants to merge 4 commits into
Supreeeme:mainfrom
skryvel:logging-improvements

Conversation

@skryvel

@skryvel skryvel commented Aug 8, 2026

Copy link
Copy Markdown

Split out of #397. Partly addresses #73 — the log history half of it; the persistent crash popup that issue also asks for is not covered here.

Concurrent processes were destroying each other's logs. More than one process can run xrizer at once — Proton games typically start a short-lived process that checks for a headset before the game itself launches — and each truncated the same xrizer.txt on startup. Debugging a game, I lost its entire early log to a probe that started afterwards and punched a hole of NUL bytes over it. Each process now writes xrizer-<timestamp>-<pid>.txt. The timestamp is there so the files sort chronologically; pids get reused across reboots. Files older than two days are removed on startup so the directory doesn't grow forever.

The crash dialog's "Copy to clipboard" usually pasted nothing. miniquad's clipboard only serves paste requests while its window is alive, and is unimplemented on some backends, so the backtrace was gone by the time you had somewhere to put it. It now pipes through wl-copy/xclip/xsel when one is available, and says so when it had to fall back. The copied text includes the error message, not just the backtrace, and the "Open log file" button opens the file this process actually wrote.

RUST_LOG doesn't always reach the game. Some launch setups sanitize the environment, which makes it impossible to raise the log level for the process you care about. If RUST_LOG is unset, a log_filter file in the log directory is read instead, containing the same filter string.

A 32-bit build failed to load with a message that didn't say why. Since #202 the default build loads the OpenXR loader at runtime, and a 32-bit xrizer on a machine with only the 64-bit loader installed dies with wrong ELF class: ELFCLASS64 and nothing else — I lost time to this twice before working out what it wanted. The panic now says it needs a 32-bit loader, or a build with --features static-openxr.

skryvel added 4 commits August 8, 2026 00:35
Multiple processes can run xrizer concurrently (e.g. a launcher's VR
probe alongside the game itself). They all truncated the same
xrizer.txt on init, clobbering each other's output - a probe could
punch a NUL hole over the game's entire early log. Give each process
its own xrizer-<timestamp>-<pid>.txt instead, and remove files older
than two days on startup so the directory doesn't grow without bound.

The timestamp is there so logs sort chronologically; pids are reused
across reboots. This covers the log history half of Supreeeme#73 - the
persistent crash popup it also asks for is not addressed here.
miniquad's clipboard only serves pastes while the dialog window is
alive, and is unimplemented on some Linux backends, so pastes usually
came up empty. Prefer wl-copy/xclip/xsel, which keep the selection
alive, and tell the user when we had to fall back. Also include the
error message itself in the copied text.

The log file button now opens the per-process log file.
Steam launch options do not reliably deliver environment variables to
every game process (observed with SUPERHOT VR, where identical launch
options applied RUST_LOG on one run and not the next). When RUST_LOG is
absent, read the filter from <state dir>/xrizer/log_filter instead so
trace logging can be enabled regardless of how the game is launched.
A 32-bit xrizer build without the static-openxr feature dlopens the
system libopenxr_loader.so and dies with "wrong ELF class" on systems
that only have the 64-bit loader. Spell out the actual requirement in
the panic message.
@skryvel
skryvel marked this pull request as ready for review August 8, 2026 15:02
@skryvel skryvel mentioned this pull request Aug 8, 2026
@skryvel skryvel changed the title log to per-process files, and make crash reports easier to collect log to per-process files, and make crash reports easier to collect (partial #73) Aug 8, 2026
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