Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Motivation Get the string representation of the `Level` is quite a common usecase. Without this method, I normally need to implement it by myself, which is fairly noisy. ```rust #[inline] fn level_to_str(level: &tracing::Level) -> &'static str { match *level { tracing::Level::TRACE => "TRACE", tracing::Level::DEBUG => "DEBUG", tracing::Level::INFO => "INFO", tracing::Level::WARN => "WARN", tracing::Level::ERROR => "ERROR" } } ``` ## Solution Add an `as_str()` method for `Level`. Similar to [log::Level::as_str()][1]. [1] https://docs.rs/log/0.4.14/log/enum.Level.html#method.as_str
- Loading branch information