⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module log_service

Module log_service 

Source
Expand description

Structured kernel log service

Provides a fixed-size, heap-free circular buffer of structured log entries. Each entry carries a timestamp, severity level, subsystem tag, and a fixed-length message. The service is stored as global state behind a [spin::Mutex] and accessed through a small public API.

§Usage

log_service::log_init();
log_service::klog(LogLevel::Info, "sched", "scheduler initialized");
let n = log_service::log_count();

The buffer holds up to [LOG_BUFFER_CAPACITY] entries. Once full it wraps around and silently overwrites the oldest entries.

Structs§

LogEntry
A single structured log entry.

Enums§

LogLevel
Severity levels for kernel log messages.

Functions§

klog
Record a structured log entry.
log_clear
Clear all log entries.
log_count
Return the number of entries currently in the log buffer.
log_drain
Iterate over all buffered log entries from oldest to newest, calling f for each.
log_init
Initialize the kernel log service.