Skip to main content

Module output

Module output 

Source
Expand description

Saying things without staking the process on being heard.

println! and eprintln! panic when the write fails, which is the right call for a program whose output is the result and the wrong one for anything that has to keep running. A process whose output goes to a pipe nobody reads any more, or that a supervisor started with its streams closed, hits a broken pipe the next time it says anything; a server dies there, in the middle of answering somebody. A lost line of log is the smaller loss.

So diagnostics go out through here: the line is written whenever anything is listening, and dropped when nothing is.

Functionsยง

to_stderr
Write a line to stderr, or drop it.
to_stdout
Write a line to stdout, or drop it.