=== log: one line to stdout and the session log
--- stdout
[2026-10-18 00:00:00] Selected T-1 (lane 2)
--- stderr
rc=0
--- session log
[2026-10-18 00:00:00] Selected T-1 (lane 2)
=== log: several arguments are joined
--- stdout
[2026-10-18 00:00:00] a b  c d
--- stderr
rc=0
--- session log
[2026-10-18 00:00:00] a b  c d
=== log: an empty message
--- stdout
[2026-10-18 00:00:00] 
--- stderr
rc=0
--- session log
[2026-10-18 00:00:00] 
=== log: format characters are literal
--- stdout
[2026-10-18 00:00:00] %s %d \n 100% done
--- stderr
rc=0
--- session log
[2026-10-18 00:00:00] %s %d \n 100% done
=== log_section: the banner
--- stdout
[2026-10-18 00:00:00] ======================================================
[2026-10-18 00:00:00]  Run started (3 tasks)
[2026-10-18 00:00:00] ======================================================
--- stderr
rc=0
--- session log
[2026-10-18 00:00:00] ======================================================
[2026-10-18 00:00:00]  Run started (3 tasks)
[2026-10-18 00:00:00] ======================================================
=== error: stderr and the session log
--- stdout
--- stderr
[ERROR 2026-10-18 00:00:00]   x Tests failed
rc=0
--- session log
[ERROR 2026-10-18 00:00:00]   x Tests failed
=== warn: stderr and the session log, its own marker
--- stdout
--- stderr
[WARN 2026-10-18 00:00:00] carrying 2 lines for a retired story
rc=0
--- session log
[WARN 2026-10-18 00:00:00] carrying 2 lines for a retired story
=== all four in order (the session log interleaves them)
--- stdout
[2026-10-18 00:00:00] first
[2026-10-18 00:00:00] ======================================================
[2026-10-18 00:00:00]  fourth
[2026-10-18 00:00:00] ======================================================
--- stderr
[ERROR 2026-10-18 00:00:00] second
[WARN 2026-10-18 00:00:00] third
rc=0
--- session log
[2026-10-18 00:00:00] first
[ERROR 2026-10-18 00:00:00] second
[WARN 2026-10-18 00:00:00] third
[2026-10-18 00:00:00] ======================================================
[2026-10-18 00:00:00]  fourth
[2026-10-18 00:00:00] ======================================================
=== the session log is appended to, never truncated
--- stdout
[2026-10-18 00:00:00] appended
--- stderr
rc=0
--- session log
existing line
[2026-10-18 00:00:00] appended
=== log: SESSION_LOG unset under set -u
--- stdout
[2026-10-18 00:00:00] x
--- stderr
<where>: SESSION_LOG: unbound variable
rc=1
--- session log
=== error: an unwritable session log
--- stdout
--- stderr
[ERROR 2026-10-18 00:00:00] y
<where>: <SB>/no/such/dir/session.log: No such file or directory
rc=1
--- session log
(none)
