Skip to main content

LogFormat

Trait LogFormat 

Source
pub trait LogFormat: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn sessions_dir(&self, project: Option<&Path>) -> PathBuf;
    fn list_sessions(&self, project: Option<&Path>) -> Vec<SessionFile>;
    fn detect(&self, path: &Path) -> f64;
    fn parse(&self, path: &Path) -> Result<Session, String>;
}
Expand description

Trait for session log format plugins.

Required Methods§

Source

fn name(&self) -> &'static str

Format identifier (e.g., “claude”, “codex”, “gemini”, “moss”).

Source

fn sessions_dir(&self, project: Option<&Path>) -> PathBuf

Get the sessions directory for this format. Does NOT check if the directory exists - that’s handled by list_sessions.

Source

fn list_sessions(&self, project: Option<&Path>) -> Vec<SessionFile>

List all session files for this format.

Source

fn detect(&self, path: &Path) -> f64

Check if this format can parse the given file. Returns a confidence score 0.0-1.0.

Source

fn parse(&self, path: &Path) -> Result<Session, String>

Parse the log file into a unified Session structure.

Implementors§