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, ParseError>;
// Provided methods
fn list_subagent_sessions(
&self,
_project: Option<&Path>,
) -> Vec<SessionFile> { ... }
fn metadata_roots(&self, project: Option<&Path>) -> Vec<PathBuf> { ... }
}Expand description
Trait for session log format plugins.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Format identifier (e.g., “claude”, “codex”, “gemini”, “normalize”).
Sourcefn sessions_dir(&self, project: Option<&Path>) -> PathBuf
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.
Sourcefn list_sessions(&self, project: Option<&Path>) -> Vec<SessionFile>
fn list_sessions(&self, project: Option<&Path>) -> Vec<SessionFile>
List all session files for this format.
Provided Methods§
Sourcefn list_subagent_sessions(&self, _project: Option<&Path>) -> Vec<SessionFile>
fn list_subagent_sessions(&self, _project: Option<&Path>) -> Vec<SessionFile>
List subagent session files for this format. Default returns empty (only Claude Code supports subagents currently).
Sourcefn metadata_roots(&self, project: Option<&Path>) -> Vec<PathBuf>
fn metadata_roots(&self, project: Option<&Path>) -> Vec<PathBuf>
Returns external directories (outside the project root) that belong to this format’s
session metadata for the given project. Used by normalize sync to copy metadata
alongside the project.
Default implementation delegates to sessions_dir. Override only if your format
stores metadata in multiple locations.