Add opt-in file logging for freeze/debug diagnosis #11

Open
opened 2026-04-09 16:40:15 +00:00 by a73x · 0 comments
a73x commented 2026-04-09 16:40:15 +00:00 (Migrated from git.a73x.sh)

Waystty currently has no persistent runtime log file, which makes freezes hard to investigate after the fact. Runtime diagnostics mostly go to stderr/stdout, and if the app was launched from a compositor or app launcher there may be nothing useful left to inspect.

Proposal:

  • Add opt-in file logging rather than always-on logging.
  • If WAYSTTY_LOG is set, append structured log lines to the given path.
  • Keep default behavior unchanged when the env var is unset.
  • Log enough state to diagnose hangs and event-loop stalls without being excessively noisy.

Suggested scope:

  • Initialize a process-wide logger early in startup.
  • Record timestamps, level, subsystem, and message.
  • Cover startup, Wayland connection/configure events, PTY read/write activity, resize/scale changes, render loop transitions, and fatal errors.
  • Ensure logging failures do not crash the terminal.

Why opt-in:

  • Avoids disk churn in normal use.
  • Keeps the default terminal experience clean.
  • Makes it easy to repro with WAYSTTY_LOG=/tmp/waystty.log waystty when debugging a freeze.

Open questions:

  • Whether to also support a default XDG state path later (for example ~/.local/state/waystty/waystty.log).
  • Whether to buffer, line-buffer, or fsync on each write.

Migrated from git-collab issue 7b6053b0e92a4b9bed0c3ef970bd8d1a4b32f96b.

Original author: a73x dev@a73x.sh.

Waystty currently has no persistent runtime log file, which makes freezes hard to investigate after the fact. Runtime diagnostics mostly go to stderr/stdout, and if the app was launched from a compositor or app launcher there may be nothing useful left to inspect. Proposal: - Add opt-in file logging rather than always-on logging. - If `WAYSTTY_LOG` is set, append structured log lines to the given path. - Keep default behavior unchanged when the env var is unset. - Log enough state to diagnose hangs and event-loop stalls without being excessively noisy. Suggested scope: - Initialize a process-wide logger early in startup. - Record timestamps, level, subsystem, and message. - Cover startup, Wayland connection/configure events, PTY read/write activity, resize/scale changes, render loop transitions, and fatal errors. - Ensure logging failures do not crash the terminal. Why opt-in: - Avoids disk churn in normal use. - Keeps the default terminal experience clean. - Makes it easy to repro with `WAYSTTY_LOG=/tmp/waystty.log waystty` when debugging a freeze. Open questions: - Whether to also support a default XDG state path later (for example `~/.local/state/waystty/waystty.log`). - Whether to buffer, line-buffer, or fsync on each write. --- Migrated from git-collab issue `7b6053b0e92a4b9bed0c3ef970bd8d1a4b32f96b`. Original author: a73x <dev@a73x.sh>.
Sign in to join this conversation.
No labels
backlog
review
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
a73x/waystty#11
No description provided.