tsk/agent/log_processor.rs
1use async_trait::async_trait;
2use std::path::Path;
3
4/// Trait for processing agent log output
5#[async_trait]
6pub trait LogProcessor: Send {
7 /// Process a single line of log output
8 /// Returns Some(formatted_output) if the line should be displayed, None otherwise
9 fn process_line(&mut self, line: &str) -> Option<String>;
10
11 /// Get the full log content
12 #[allow(dead_code)]
13 fn get_full_log(&self) -> String;
14
15 /// Save the full log to a file
16 async fn save_full_log(&self, path: &Path) -> Result<(), String>;
17
18 /// Get the final result of the task execution
19 fn get_final_result(&self) -> Option<&super::TaskResult>;
20}