Expand description
Hardware-free: builds and is tested on the host too. Console line formatting, hardware-free so it is host-tested.
A log record is formatted into a fixed [LINE_CAP] buffer, which the caller
owns, before it enters the ring. heapless::String refuses a push_str that
does not fit WHOLE, so formatting straight into it dropped an over-long
argument without a trace: [csv-hdr] arrived with nothing after it.
[format_into] cuts at the last character that fits and says so with
[TRUNC_MARK]. Records longer than one line go through
console::send_record, which has no line buffer at all.
Constants§
- HEADER_
CAP - Longest
[SSSSS.mmm LEVEL]header: a u64 second count is 20 digits. - LINE_
CAP - Per-line format buffer for the log path.
- TRUNC_
MARK - Ends a line
format_intohad to cut. ASCII, so it renders anywhere.
Functions§
- format_
into - One CRLF-terminated line into
line, replacing what it held: header, thenargsas far as they fit. A cut line ends inTRUNC_MARK, so a missing tail is visible, never silent. In place, so the caller decides where the line lives: no line buffer is ever on the stack of the code that logs. - header
[SSSSS.mmm LEVEL], the header every console line starts with.