lessence 0.3.1

Extract the essence of your logs — compress repetitive lines while preserving all unique information
Documentation
// Simple output format support for multi-format implementation
// This is a basic implementation to support the CLI --format flag

#[derive(Debug, Clone, PartialEq)]
pub enum OutputFormat {
    Text,
    Markdown,
}

impl std::str::FromStr for OutputFormat {
    type Err = anyhow::Error;

    fn from_str(s: &str) -> anyhow::Result<Self> {
        match s.to_lowercase().as_str() {
            "text" | "plain" => Ok(OutputFormat::Text),
            "markdown" | "md" => Ok(OutputFormat::Markdown),
            "json" => Err(anyhow::anyhow!(
                "Error: Invalid format 'json'. Supported formats: text, markdown"
            )),
            _ => Err(anyhow::anyhow!(
                "Error: Invalid format '{s}'. Supported formats: text, markdown"
            )),
        }
    }
}