pub fn cleanup_old_logs(log_dir: &Path, retention_days: u32) -> Result<()>Expand description
Clean up old log files based on retention policy
Scans the log directory and removes files older than the specified retention period.
Only removes files matching the pattern .log.YYYY-MM-DD (rotated log files).
§Arguments
log_dir- Directory containing log filesretention_days- Number of days to retain logs (default: 7)
§Example
use std::path::Path;
use intent_engine::logging::cleanup_old_logs;
let log_dir = Path::new("/home/user/.intent-engine/logs");
cleanup_old_logs(log_dir, 7).ok();