diff --git a/src/lib.rs b/src/lib.rs index 6c222baef..989125c25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -243,6 +243,8 @@ static MAX_LOG_LEVEL_FILTER: AtomicUsize = ATOMIC_USIZE_INIT; static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"]; +static LOG_LEVEL_EMOJIES: [&'static str; 6] = ["", "❤️", "💛", "💙", + "💚", "💜"]; /// An enum representing the available verbosity levels of the logging framework /// @@ -370,6 +372,11 @@ impl LogLevel { } } + /// Returns emoji representation of logging level + pub fn emoji(&self) -> &'static str { + LOG_LEVEL_EMOJIES[*self as usize] + } + /// Returns the most verbose logging level. #[inline] pub fn max() -> LogLevel {