Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add emoji to log level name for iOS #108

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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 {
Expand Down