Macro mt_logger::mt_flush[][src]

macro_rules! mt_flush {
    () => { ... };
}
Expand description

Blocks the calling thread until all messages have been received by the logging thread.

Returns [Result<(), MtLoggerError>]

Examples

Flush all sent messages.

mt_log!(Level::Debug, "messages");
mt_log!(Level::Debug, "may");
mt_log!(Level::Debug, "not");
mt_log!(Level::Debug, "have");
mt_log!(Level::Debug, "been");
mt_log!(Level::Debug, "received");
mt_log!(Level::Debug, "yet.");

mt_flush!()?;
// Now they have!

Ok(())

Errors

As this function is effectively a send and blocking receive, it is possible for either of these calls to fail, and those errors will propagate back to the caller.

See MtLoggerError for an enumeration of errors that may be returned.