Skip to content

kernel::debug::log

struct BufWriter<'a> {
pub buf: &'a mut [u8],
pub pos: usize,
}

Helper: write a formatted byte string.

Implements: Write

fn dump()

Dump the ring buffer to the console.

Nothing calls this yet – it is waiting on a shell – but it is the only read path out of RING_BUF, which every log line writes to. Delete it and the ring buffer becomes write-only storage that costs RAM and returns nothing, so the honest cleanup would be to delete the ring as well. It earns its place the first time a panic handler or a dmesg command needs the last N lines that did not make it out of the UART.

fn write(level: api::debug::log::Level, args: &core::fmt::Arguments<'_>)

Write a log message. Called from the syscall entry.

References: Level