Skip to main content

new

Function new 

Source
pub fn new(proc_name: &str, logs_dir: &str) -> Result<Logger, Error>
Expand description

Ported from New.

Deviates from Go by not also writing to real stdout/stderr (Go’s New always fans out to os.Stdout/os.Stderr via io.MultiWriter, plus the log file when logs_dir is non-empty). This port writes to the log file only when logs_dir is non-empty, and to std::io::sink() otherwise, since fanning test output into the test runner’s real stdout/stderr on every ported test isn’t useful and there’s no testable seam yet to intercept it (see logger_info’s test comment and PORT_NOTES.md); wiring the real stdout/stderr fan-out is Phase 4 work once that seam exists.