pub struct KernelEventLog { /* private fields */ }Expand description
Thread-safe ring buffer for kernel runtime events.
Captures boot events and any post-boot events (service starts/stops,
agent spawns, health checks, errors). Holds at most capacity events
— when full, the oldest event is evicted.
Used by the daemon to serve kernel.logs RPC requests.
Implementations§
Source§impl KernelEventLog
impl KernelEventLog
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new event log with a specific capacity.
Sourcepub fn info(&self, source: &str, message: impl Into<String>)
pub fn info(&self, source: &str, message: impl Into<String>)
Push a simple info event with a source tag and message.
Sourcepub fn info_with_chain(
&self,
source: &str,
message: impl Into<String>,
chain: Option<&ChainManager>,
)
pub fn info_with_chain( &self, source: &str, message: impl Into<String>, chain: Option<&ChainManager>, )
Push an info event and optionally append to the local chain.
Sourcepub fn ingest_boot_log(&self, boot_log: &BootLog)
pub fn ingest_boot_log(&self, boot_log: &BootLog)
Ingest all events from a BootLog (used to seed boot events).
Sourcepub fn tail(&self, n: usize) -> Vec<BootEvent>
pub fn tail(&self, n: usize) -> Vec<BootEvent>
Get the last n events (or all if n is 0 or exceeds count).
Trait Implementations§
Source§impl Debug for KernelEventLog
impl Debug for KernelEventLog
Auto Trait Implementations§
impl !Freeze for KernelEventLog
impl RefUnwindSafe for KernelEventLog
impl Send for KernelEventLog
impl Sync for KernelEventLog
impl Unpin for KernelEventLog
impl UnsafeUnpin for KernelEventLog
impl UnwindSafe for KernelEventLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more