Skip to content

Fix/xdg session log directory - #169

Draft
marcoallegretti wants to merge 2 commits into
bea4dev:mainfrom
marcoallegretti:fix/xdg-session-log-directory
Draft

marcoallegretti wants to merge 2 commits into
bea4dev:mainfrom
marcoallegretti:fix/xdg-session-log-directory

Conversation

@marcoallegretti

Copy link
Copy Markdown
Contributor

Fixes #164.

Store session logs under $XDG_STATE_HOME/shoji_wm/logs/, falling back to
~/.local/state/shoji_wm/logs/. Ignore empty or relative XDG_STATE_HOME
values. Add SHOJI_LOG_DIR to override the complete directory; empty
overrides are ignored.

Timescope profiles use the same resolver. Rotation and retention remain
unchanged and operate within the selected directory.

The default-path change does not migrate or delete files under
~/shoji_wm/logs/. Selecting that directory with SHOJI_LOG_DIR preserves
the old location, with normal rotation and retention applying there.

Update English/Japanese documentation and the profiler SDK comment.

API impact:

  • No Rust or TypeScript signature changes.
  • New environment option: SHOJI_LOG_DIR.
  • The default log/profile directory changes.
  • No new CLI option or dependency.

Validation:

  • The original path-resolution regression test failed against the previous
    behavior.
  • cargo test -p shojiwm_lib --lib --locked log_path_tests:
    3 parent tests and 13 child executions passed.
    These verify environment precedence, flushed log contents, real Timescope
    reports containing a recorded sample, profile rotation, log rotation,
    overwrite mode, byte/age retention and preservation of legacy files.
  • Rebuilt shoji_wm and ran three nested Wayland sessions under headless
    Weston with software rendering: XDG, HOME fallback and explicit override.
    Each loaded a minimal TypeScript configuration, answered a Wayland
    registry/sync request, acknowledged quit and exited with status 0.
    Session logs and shutdown profiler reports were verified at each path.
  • npm run typecheck: passed.
  • npm --prefix docs run build: English and Japanese builds passed.
  • Rust formatting and git diff --check: passed.
  • Full library suite: 315 passed, 2 failed, 4 ignored.
    Both failures are unchanged Xwayland socket tests that cannot prepare
    /tmp/.X11-unix because it is not writable.

The existing Scene3D warnings are addressed separately by #167.
This branch starts at main and does not depend on #167 or #168.

Nested validation covers software Wayland with a minimal configuration,
not hardware DRM presentation or visual correctness.

This branch has not been deployed

No deployments
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.

Feature Request: Store session logs under XDG_STATE_HOME

1 participant