pub enum LogLevel {
ALL,
NONE,
DISABLED,
DEBUG,
TRACE,
VERBOSE,
INFO,
WARN,
ERROR,
FATAL,
CRITICAL,
}
Expand description
An enumeration of the different levels that a log message can have, ordered by severity.
Variants§
ALL
ALL
: The log level includes all levels.
NONE
NONE
: No logging.
DISABLED
DISABLED
: Logging is disabled.
DEBUG
DEBUG
: Debugging information, typically useful for developers.
TRACE
TRACE
: Finer-grained informational events than DEBUG
.
VERBOSE
VERBOSE
: Detailed logging, often more detailed than INFO
.
INFO
INFO
: Informational messages that highlight the progress of the application.
WARN
WARN
: Potentially harmful situations.
ERROR
ERROR
: Error events that might still allow the application to continue running.
FATAL
FATAL
: Very severe error events that will presumably lead the application to abort.
CRITICAL
CRITICAL
: Critical conditions, often requiring immediate attention.
Implementations§
Source§impl LogLevel
impl LogLevel
Sourcepub fn includes(self, other: LogLevel) -> bool
pub fn includes(self, other: LogLevel) -> bool
Checks if the current log level includes another log level.
§Arguments
other
- The log level to compare with.
§Examples
use rlg::log_level::LogLevel;
assert!(LogLevel::ERROR.includes(LogLevel::DEBUG)); // ERROR includes DEBUG
assert!(!LogLevel::DEBUG.includes(LogLevel::WARN)); // DEBUG does not include WARN
assert!(LogLevel::WARN.includes(LogLevel::DEBUG)); // WARN includes DEBUG
Sourcepub fn to_numeric(self) -> u8
pub fn to_numeric(self) -> u8
Converts the log level to its corresponding numeric value, similar to syslog severity levels.
§Examples
use rlg::log_level::LogLevel;
assert_eq!(LogLevel::ERROR.to_numeric(), 8);
assert_eq!(LogLevel::DEBUG.to_numeric(), 3);
Sourcepub fn from_numeric(value: u8) -> Option<Self>
pub fn from_numeric(value: u8) -> Option<Self>
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>,
Source§impl Ord for LogLevel
impl Ord for LogLevel
Source§impl PartialOrd for LogLevel
impl PartialOrd for LogLevel
impl Copy for LogLevel
impl Eq for LogLevel
impl StructuralPartialEq for LogLevel
Auto Trait Implementations§
impl Freeze for LogLevel
impl RefUnwindSafe for LogLevel
impl Send for LogLevel
impl Sync 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
§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.