Skip to main content

append

Function append 

Source
pub fn append(path: &Path, bark: &Bark, max_bytes: u64) -> Result<(), BarkError>
Expand description

Appends bark to path, evicting oldest-first to keep the file under max_bytes.

Eviction drops a prefix of whole lines, atomically; an oversized record is written anyway, since dropping it would silently lose the one alert too big to fit. Serialized against other appenders by an advisory lock on a sibling <path>.lock. Concurrent reads are not blocked: the ring is only ever replaced whole.

ยงErrors