Write tuimail's log as the house's standard line through logline (AHT-204) #59

Merged
merge-queue merged 2 commits from aht-204-logline into main 2026-11-26 03:59:05 -08:00
Owner

Moves tuimail's log onto the house's one log line, written by the logline crate (https://openproject.home.romaine.life/wp/AHT-204).

Before: src/logfile.rs wrote <RFC3339 ms+offset> <event> k=v... itself, to tuimail.log or to stdout for tuimail session, with its own 1 MiB rotation to tuimail.log.old.

After: each line is 2026-11-26T10:30:43.123-08:00 pid=4242 error failed op="logging in" account=2 class=timeout. That is the time, the pid, the level, the event as the message, then the same fields as before.

  • Levels: failed, crash and contained-panic are error. The session's refusals and the accounts it leaves out are warn (the new logfile::warning). start, stop, recovered, archived and the session's notes are info. The session's start line is start mode=session ....
  • logline::Logger::open_file writes the file and rotates it, still to tuimail.log.old past 1 MiB. On Unix the file is first created 0600 without following a link, as before (logfile::start). After a rotation, logline creates the new file in the private data folder.
  • The privacy rules stay. Fields are logfile::Value: a static word, a number, an ErrorKind or a panic's source place. Nothing a caller passes in is a String, and an error is still logged only by its class. Class::fields replaces Class's Display.
  • The session's stdout lines are made by logline::format, so they are the same standard line.
  • logfile::Link still logs a repeating failure once, and recovered once when it ends.

Tests: the tests that read the log (logfile, mcp, worker) go through logfile::tests::events, which checks every line with logline::parse. New tests cover each event's level and fields, rotation to OLD_FILE, and the session's stdout lines.

CLAUDE.md's description of the log is updated. The new dependency is logline = { git = "https://forgejo.romaine.life/romaine-life/logline", tag = "v0.1.0" }. It comes from Forgejo, which check-fetches requires, and the repo is public.

The open mail windows keep running the old build after the release until they are updated (TESTING.md). That isn't part of this PR.

🤖 Generated with Claude Code

Moves tuimail's log onto the house's one log line, written by the `logline` crate (https://openproject.home.romaine.life/wp/AHT-204). **Before:** `src/logfile.rs` wrote `<RFC3339 ms+offset> <event> k=v...` itself, to `tuimail.log` or to stdout for `tuimail session`, with its own 1 MiB rotation to `tuimail.log.old`. **After:** each line is `2026-11-26T10:30:43.123-08:00 pid=4242 error failed op="logging in" account=2 class=timeout`. That is the time, the pid, the level, the event as the message, then the same fields as before. - Levels: `failed`, `crash` and `contained-panic` are error. The session's refusals and the accounts it leaves out are warn (the new `logfile::warning`). `start`, `stop`, `recovered`, `archived` and the session's notes are info. The session's start line is `start mode=session ...`. - `logline::Logger::open_file` writes the file and rotates it, still to `tuimail.log.old` past 1 MiB. On Unix the file is first created 0600 without following a link, as before (`logfile::start`). After a rotation, logline creates the new file in the private data folder. - The privacy rules stay. Fields are `logfile::Value`: a static word, a number, an `ErrorKind` or a panic's source place. Nothing a caller passes in is a `String`, and an error is still logged only by its class. `Class::fields` replaces `Class`'s `Display`. - The session's stdout lines are made by `logline::format`, so they are the same standard line. - `logfile::Link` still logs a repeating failure once, and `recovered` once when it ends. **Tests:** the tests that read the log (`logfile`, `mcp`, `worker`) go through `logfile::tests::events`, which checks every line with `logline::parse`. New tests cover each event's level and fields, rotation to `OLD_FILE`, and the session's stdout lines. CLAUDE.md's description of the log is updated. The new dependency is `logline = { git = "https://forgejo.romaine.life/romaine-life/logline", tag = "v0.1.0" }`. It comes from Forgejo, which check-fetches requires, and the repo is public. The open `mail` windows keep running the old build after the release until they are updated (TESTING.md). That isn't part of this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tuimail.log and the session's stdout now carry logline's line: the time with
milliseconds and zone, pid, level, the event as the message, then key=value
fields. Events and fields are unchanged (start, stop, failed op/account/class,
recovered, crash, contained-panic); levels added (failed, crash and
contained-panic are error, refusals warn, the rest info). Fields are static
words and numbers only (logfile::Value), so the log's privacy rules stand.
logline writes and rotates the file; tests read it with logline::parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fetch logline from Forgejo, where check-fetches wants it (AHT-204)
All checks were successful
Suite release / build (rust, aarch64-pc-windows-msvc) (, rust-aarch64-pc-windows-msvc, aarch64-pc-windows-msvc, false, windows-latest, aarch64-pc-windows-msvc, rust) (pull_request) Has been skipped
Suite release / build (rust, aarch64-unknown-linux-gnu) (, rust-aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu, false, ubuntu-latest, aarch64-unknown-linux-gnu, rust) (pull_request) Has been skipped
Suite release / build (rust, x86_64-pc-windows-msvc) (, rust-x86_64-pc-windows-msvc, x86_64-pc-windows-msvc, false, windows-latest, x86_64-pc-windows-msvc, rust) (pull_request) Has been skipped
Suite release / build (rust, x86_64-unknown-linux-gnu) (, rust-x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu, false, ubuntu-latest, x86_64-unknown-linux-gnu, rust) (pull_request) Has been skipped
Suite rust / check-services (pull_request) Successful in 2m0s
Suite release / check-build (rust, aarch64-pc-windows-msvc) (, rust-aarch64-pc-windows-msvc, aarch64-pc-windows-msvc, false, windows-latest, aarch64-pc-windows-msvc, rust) (pull_request) Successful in 2m30s
Suite release / dispatch (pull_request) Has been skipped
Suite default / check-fetches (pull_request) Successful in 6s
Suite rust / check-format (pull_request) Successful in 8s
Suite rust / check-test-linux (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite default / reused-checks (pull_request) Successful in 7s
Suite cluster-service / reused-checks (pull_request) Successful in 7s
Suite rust / check-audit (pull_request) Successful in 8s
Suite rust / check-typos (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite rust / check-machete (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / check-build (rust, x86_64-unknown-linux-gnu) (, rust-x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu, false, ubuntu-latest, x86_64-unknown-linux-gnu, rust) (pull_request) Successful in 1m37s
Suite rust / check-test-windows (pull_request) Successful in 2m9s
Suite rust / reused-checks (pull_request) Successful in 5s
Suite release / check-build (rust, aarch64-unknown-linux-gnu) (, rust-aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu, false, ubuntu-latest, aarch64-unknown-linux-gnu, rust) (pull_request) Successful in 2m38s
Suite release / check-build (rust, x86_64-pc-windows-msvc) (, rust-x86_64-pc-windows-msvc, x86_64-pc-windows-msvc, false, windows-latest, x86_64-pc-windows-msvc, rust) (pull_request) Successful in 4m4s
Suite release / check-package (pull_request) Successful in 3m7s
merge-queue landed on main
Suite release / reused-checks (pull_request) Successful in 3s
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deploy-image (push) Has been skipped
fc06a88eb1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
merge-queue deleted branch aht-204-logline 2026-11-26 03:59:05 -08:00
Sign in to join this conversation.
No description provided.