pub enum LogLevel {
Debug,
Error,
Info,
Trace,
Warn,
Off,
}Expand description
The LogLevel implementation is a custom enumeration of compatible logging levels for the
application, providing options for debug, error, info, trace, warn, and off levels. this is
primarily done to ensure proper serialization and deserialization within configuration
files.
Variants§
Implementations§
Source§impl LogLevel
impl LogLevel
Sourcepub const fn is_debug(&self) -> bool
pub const fn is_debug(&self) -> bool
Returns true if the enum is LogLevel::Debug otherwise false
Sourcepub const fn is_error(&self) -> bool
pub const fn is_error(&self) -> bool
Returns true if the enum is LogLevel::Error otherwise false
Source§impl LogLevel
impl LogLevel
Sourcepub fn from_tracing_level(level: Level) -> Self
pub fn from_tracing_level(level: Level) -> Self
Converts a tracing::Level to a LogLevel
Sourcepub fn from_level_filter(filter: LevelFilter) -> Self
pub fn from_level_filter(filter: LevelFilter) -> Self
Converts a LevelFilter to a LogLevel
pub fn as_tracing_level(&self) -> Option<Level>
pub fn as_level_filter(&self) -> LevelFilter
pub fn as_env_filter(&self, name: &str) -> EnvFilter
pub fn fmt_as_env_filter(&self, name: &str) -> String
pub fn init_tracing(&self, name: &str)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogLevel
impl<'de> Deserialize<'de> for LogLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<LevelFilter> for LogLevel
impl From<LevelFilter> for LogLevel
Source§fn from(filter: LevelFilter) -> Self
fn from(filter: LevelFilter) -> Self
Converts to this type from the input type.
Source§impl From<LogLevel> for LevelFilter
impl From<LogLevel> for LevelFilter
Source§impl IntoEnumIterator for LogLevel
impl IntoEnumIterator for LogLevel
type Iterator = LogLevelIter
fn iter() -> LogLevelIter ⓘ
Source§impl Ord for LogLevel
impl Ord for LogLevel
Source§impl PartialOrd for LogLevel
impl PartialOrd for LogLevel
Source§impl VariantNames for LogLevel
impl VariantNames for LogLevel
impl Copy for LogLevel
impl Eq for LogLevel
impl Send for LogLevel
impl StructuralPartialEq for LogLevel
impl Sync for LogLevel
Auto Trait Implementations§
impl Freeze for LogLevel
impl RefUnwindSafe for LogLevel
impl Unpin for LogLevel
impl UnwindSafe for LogLevel
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