Migrate Logs V1
tools.migrate_logs_v1
migrate_logs_v1.py — rename pre-v2 xil logs to the versioned convention.
Lives in tools/; run from anywhere: python3 tools/migrate_logs_v1.py [-n]
Before v2, logs/xil_YYYY-MM-DD.log held a bare copy of the terminal
transcript (no timestamp, level or stage per line). v2 writes a structured
logs/xil_v2_YYYY-MM-DD.log instead, so the old files are renamed to
xil_v1_YYYY-MM-DD.log and the format is unambiguous from the filename —
no sniffing, and xil-stem-log / xil_effort can parse both.
Only files matching xil_YYYY-MM-DD.log exactly are touched. Anything else
in logs/ (already-versioned files, unrelated *.log files) is left alone.
Safe to re-run: already-renamed files are reported as skipped.
Files currently held open by another process are skipped. Renaming a log
that a running xil command or xil-gui still has open leaves the writer
appending to the old inode, and on a network mount (9p/NFS/SMB) it can leave
the new name unresolvable until that process exits. Today's log is normally
the only one at risk; stop the writer (or wait for it to finish) and re-run.
Log directory: $XIL_PROJECTROOT/logs, falling back to ./logs.