Skip to main content

forward_to_stderr

Function forward_to_stderr 

Source
pub fn forward_to_stderr(
    target: &str,
    record_suffix: &str,
    _index: u64,
    message: Arguments<'_>,
)
Expand description

A DetlogForwarder for a tool that runs inside the guest process and shares the guest’s standard error: it writes each record as one [forwarded_line] there, where Hermit’s verification separates the records from the guest’s own output by their text.

It uses one raw write per record, so records from several guest threads cannot interleave, and it avoids tracing’s thread-local dispatcher, which libc’s final exit_group can reach after Rust thread-local destruction has begun. A write error drops the record. The calling thread’s errno is preserved.