mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-26 14:34:32 +00:00

## Summary Attempting to fix, e.g., `logging . warn("Hello World!")` was causing a syntax error.
25 lines
645 B
Rust
25 lines
645 B
Rust
#[derive(Debug, Copy, Clone)]
|
|
pub enum LoggingLevel {
|
|
Debug,
|
|
Critical,
|
|
Error,
|
|
Exception,
|
|
Info,
|
|
Warn,
|
|
Warning,
|
|
}
|
|
|
|
impl LoggingLevel {
|
|
pub fn from_attribute(level: &str) -> Option<Self> {
|
|
match level {
|
|
"debug" => Some(LoggingLevel::Debug),
|
|
"critical" => Some(LoggingLevel::Critical),
|
|
"error" => Some(LoggingLevel::Error),
|
|
"exception" => Some(LoggingLevel::Exception),
|
|
"info" => Some(LoggingLevel::Info),
|
|
"warn" => Some(LoggingLevel::Warn),
|
|
"warning" => Some(LoggingLevel::Warning),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|