pub enum LogLevel {
Debug = 0,
Info = 1,
Warning = 2,
Error = 3,
Critical = 4,
}
Expand description
Log severity levels in ascending order of importance.
Levels can be compared and ordered: Debug < Info < Warning < Error < Critical
Variants§
Implementations§
Source§impl LogLevel
impl LogLevel
Sourcepub fn color(&self) -> &'static str
pub fn color(&self) -> &'static str
Returns the ANSI color code for terminal output (requires console
feature).
Sourcepub fn should_log(&self, min_level: LogLevel) -> bool
pub fn should_log(&self, min_level: LogLevel) -> bool
Determines if this log level should be logged given the minimum level.
Returns true
if this level is equal to or higher than the minimum level.
§Examples
use telelog::LogLevel;
assert!(LogLevel::Error.should_log(LogLevel::Info));
assert!(!LogLevel::Debug.should_log(LogLevel::Info));
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 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
Mutably borrows from an owned value. Read more