static-text: add new utility
This commit is contained in:
parent
8f57f72d14
commit
97f7b68369
10 changed files with 150 additions and 15 deletions
|
|
@ -77,6 +77,7 @@ use {
|
|||
rc_eq::RcEq,
|
||||
refcounted::RefCounted,
|
||||
run_toplevel::RunToplevel,
|
||||
static_text::StaticText,
|
||||
tri::Try,
|
||||
},
|
||||
version::VERSION,
|
||||
|
|
@ -850,6 +851,19 @@ impl From<LevelFilter> for LogLevel {
|
|||
}
|
||||
}
|
||||
|
||||
impl StaticText for LogLevel {
|
||||
fn text(&self) -> &'static str {
|
||||
match self {
|
||||
LogLevel::Off => "Off",
|
||||
LogLevel::Error => "Error",
|
||||
LogLevel::Warn => "Warn",
|
||||
LogLevel::Info => "Info",
|
||||
LogLevel::Debug => "Debug",
|
||||
LogLevel::Trace => "Trace",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ConfigLogLevel> for LogLevel {
|
||||
fn from(value: ConfigLogLevel) -> Self {
|
||||
match value {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue