Skip to main content

decode_log_line

Function decode_log_line 

Source
pub fn decode_log_line(bytes: &[u8]) -> DecodedLine
Expand description

Decode one raw log line: drop the newline, classify, lossy-recover.

For readers that own their read loop. A tail -f follower cannot use read_log_lines, which ends at EOF rather than waiting for more bytes, but must classify identically instead of re-deriving this decision.

A CR before the newline is kept. LogStream counts a line’s bytes against mod_logfile’s write budget, so a byte dropped here is one it cannot count; it trims the CR itself, after counting.