Skip to main content

Module log_capture

Module log_capture 

Source
Expand description

Per-run diagnostic log capture for test harnesses.

Spawned daemons discard stdout/stderr by design (a detached daemon must not rely on drained pipes), which makes flaky failures undiagnosable. Harnesses use apply_test_logging to point each spawned process at TERM_WM_LOG_FILE (see term-wm-config) under a stable root directory that CI can archive on failure.

Functionsยง

apply_test_logging
Configure a spawned test process to write its diagnostics to a unique file under test_log_dir: sets TERM_WM_LOG_FILE (file logging) and RUST_LOG=debug (verbose enough to see bind/startup traces).
test_log_dir
The directory this test process writes captured logs into. Created lazily by test_log_file.
test_log_file
A unique log file path under test_log_dir for the given label (e.g. a gateway name slug). Creates the directory on demand.