pub enum Level {
Info,
Warning,
Error,
Fatal,
Shutdown,
}Expand description
The severity level of a log entry.
Levels are assigned by each error type through the Loggable trait, which allows
individual domain errors to decide their own severity without requiring a centralized
match statement in the middleware.
The admin CLI (kosh-cli) uses these levels to apply color coding and filtering
when rendering the log feed.
Variants§
Info
Routine informational events: successful logins, uploads, health checks.
Warning
Events that are abnormal but non-fatal: client authentication failures, request conflicts, or resource not found responses.
Error
Unexpected failures that affect a single request but do not crash the service: database query errors, storage write failures.
Fatal
Critical failures that indicate the server may be in an unrecoverable state: vault directory missing, logger task crash.
Shutdown
A special sentinel level used to stop the logging service gracefully.
When the service receives an entry with this level, it stops its receive loop
and allows the LoggerHandler to join cleanly. This is the “poison pill”
pattern used instead of relying on channel closure, because the sender lives
inside a OnceLock and is never dropped during normal operation.
Trait Implementations§
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnsafeUnpin for Level
impl UnwindSafe for Level
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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