#[non_exhaustive]#[repr(i32)]pub enum Severity {
Unspecified = 0,
Trace = 1,
Debug = 2,
Info = 3,
Warn = 4,
Error = 5,
Fatal = 6,
}Expand description
Six-level severity matching OTel SeverityNumber buckets.
A schema declares a default_sev. Call sites may escalate or demote
through emit_at(sev); the value passed wins. See
10-data-model.md § 3.
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.
Unspecified = 0
SEVERITY_UNSPECIFIED; never appears in a well-formed envelope.
Trace = 1
Most verbose; for fine-grained tracing only.
Debug = 2
Diagnostic detail useful when chasing a problem.
Info = 3
Default for normal operational events.
Warn = 4
Something noteworthy that may require attention.
Error = 5
A failure that affected this operation.
Fatal = 6
A failure severe enough that the process is likely tearing down.
Implementations§
Source§impl Severity
impl Severity
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Stable string label; used by sinks (labels[\"sev\"]) and CLI rendering.
Sourcepub const fn otlp_number(self) -> i32
pub const fn otlp_number(self) -> i32
Map to OTLP SeverityNumber (1..=24 with 4 buckets per band).
Unspecified maps to 0; fatal maps to 21 (Fatal).
See 20-otel-and-sinks.md §
2.2.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Severity
impl<'de> Deserialize<'de> for Severity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Severity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Severity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Enumeration for Severity
impl Enumeration for Severity
Source§fn from_i32(value: i32) -> Option<Severity>
fn from_i32(value: i32) -> Option<Severity>
Convert from an
i32 wire value to the enum. Read moreSource§fn proto_name(&self) -> &'static str
fn proto_name(&self) -> &'static str
The name of this enum variant as it appears in the
.proto file.Source§impl Ord for Severity
impl Ord for Severity
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Severity
impl PartialOrd for Severity
Source§impl Serialize for Severity
impl Serialize for Severity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Severity
impl Eq for Severity
impl StructuralPartialEq for Severity
Auto Trait Implementations§
impl Freeze for Severity
impl RefUnwindSafe for Severity
impl Send for Severity
impl Sync for Severity
impl Unpin for Severity
impl UnsafeUnpin for Severity
impl UnwindSafe for Severity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.