Files
continuwuity/src/core/log/fmt_span.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
442 B
Rust
Raw Normal View History

2024-11-11 20:12:20 +00:00
use tracing_subscriber::fmt::format::FmtSpan;
use crate::Result;
#[inline]
pub fn from_str(str: &str) -> Result<FmtSpan, FmtSpan> {
match str.to_uppercase().as_str() {
| "ENTER" => Ok(FmtSpan::ENTER),
| "EXIT" => Ok(FmtSpan::EXIT),
| "NEW" => Ok(FmtSpan::NEW),
| "CLOSE" => Ok(FmtSpan::CLOSE),
| "ACTIVE" => Ok(FmtSpan::ACTIVE),
| "FULL" => Ok(FmtSpan::FULL),
| "NONE" => Ok(FmtSpan::NONE),
| _ => Err(FmtSpan::NONE),
2024-11-11 20:12:20 +00:00
}
}