#[non_exhaustive]pub enum Overflow {
Block,
DropNewest,
}std only.Expand description
What NonBlocking does when its queue is full.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Block
Wait for space. No record is ever dropped; under sustained overload the logging threads slow down to the writer’s pace.
A record at or above the logger’s flush level (see
crate::LoggerBuilder::flush_on, default Error) waits until
everything queued before it has been written and the writer
flushed, so it has reached the OS when the logging call returns.
DropNewest
Drop the record that did not fit and count it (see
NonBlocking::dropped).
Logging never waits on the writer: a record at or above the
logger’s flush level only queues a flush request for the worker
(skipped if the queue is full, since the worker flushes as soon
as it drains the queue), so it is not yet durable when the call
returns. Call crate::Logger::flush to wait. The one wait left
is on shutdown: while Sink::shutdown drains the queue,
records from other threads wait for it to finish and are then
written synchronously, so they are not lost.