(no title)
talldrinkofwhat | 1 year ago
Any tips on rolling your own? My first whack would probably be treating it like a packed message, e.g.
<start_char> <n_packed_bytes> <time> <file> <line> <n_args> <arg1_type><arg1_raw_dump> ... <format_str>
with everything aside from the format string having agreed upon byte-counts, and probably have the file names getting dumped to a lookup chart. There's probably something more elegant, but I've never been good at straying too far eclectic.
SAI_Peregrinus|1 year ago
E.g. a slice needs a length.
LEB128[2] is the same compressed integer encoding scheme used by DWARF & WASM.The entire "Data: {=[u8]}!" format string is just one byte on the wire (assuming it's in the first 255 or fewer log statements, the index is also LEB128 compressed.)
[1] https://defmt.ferrous-systems.com/design
[2] https://en.wikipedia.org/wiki/LEB128