Enum stakker::LogLevel

source ·
#[repr(u32)]
#[non_exhaustive]
pub enum LogLevel { Trace, Debug, Info, Warn, Error, Off, Audit, Open, Close, }
Expand description

Levels for logging

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Trace

Tracing (very low priority or verbose logging)

§

Debug

Debugging (low priority logging)

§

Info

Informational logging

§

Warn

Warnings

§

Error

Errors

§

Off

Logging level used to disable logging of severity-based logging levels. Anything logged at this level will be ignored.

§

Audit

Audit-level log-records are sets of key-value pairs that are intended for machine processing. The formatted log-message should be a simple record tag, with all the variable data in key-value pairs. This corresponds to trace events in OpenTelemetry, or what are called ‘metrics’ in some other systems.

§

Open

Span open. For an actor, this means actor startup. The formatted text contains the name of the object, e.g. the actor name. If the parent logging-ID is known, it is passed as a parent key-value pair.

§

Close

Span close. For an actor, this means actor termination. The formatted text may give a description of why the span closed if there was a problem. In case of actor failure, one of these presence key-values will be added: failed, dropped or killed.

Implementations§

source§

impl LogLevel

source

pub fn name(self) -> &'static str

Return the name of the LogLevel as a static string.

source

pub fn all_levels() -> &'static [LogLevel]

Return a slice containing all defined logging levels

Trait Implementations§

source§

impl Clone for LogLevel

source§

fn clone(&self) -> LogLevel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LogLevel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LogLevel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LogLevel> for LogFilter

source§

fn from(level: LogLevel) -> Self

Convert a LogLevel into a LogFilter. Where a severity level (LogLevel::Trace to LogLevel::Error) is passed, all higher severity levels are also enabled. Where LogLevel::Open or LogLevel::Close is passed, the other is also enabled. LogLevel::Audit only enables itself. LogLevel::Off gives no levels enabled.

source§

impl FromStr for LogLevel

source§

fn from_str(s: &str) -> Result<LogLevel, LogLevelError>

This does a case-insensitive match to the level names as returned by LogLevel::name

§

type Err = LogLevelError

The associated error which can be returned from parsing.
source§

impl Hash for LogLevel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for LogLevel

source§

fn cmp(&self, other: &LogLevel) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LogLevel> for LogLevel

source§

fn eq(&self, other: &LogLevel) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LogLevel> for LogLevel

source§

fn partial_cmp(&self, other: &LogLevel) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TryFrom<u8> for LogLevel

source§

fn try_from(value: u8) -> Result<Self, LogLevelError>

Convert back from u8 to a LogLevel, if value is valid

§

type Error = LogLevelError

The type returned in the event of a conversion error.
source§

impl Copy for LogLevel

source§

impl Eq for LogLevel

source§

impl StructuralEq for LogLevel

source§

impl StructuralPartialEq for LogLevel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.