[][src]Function happylog::set_progress

pub fn set_progress<'a>(pb: &'a ProgressBar) -> LogPBState<'a>

Set a progress bar that console log messages should be written to.

The indicatif progress bar facilities take over the terminal. Writing log messages directly to stderr while a progress bar is active is likely to result in corrupt output. This function sets up the logging system to write to a progress bar's println method. It returns an object that, when dropped, unsets the saved progress bar target.

Example:

let _pbs = happylog::set_progress(&pb);
pb.finish_and_clear()