(
project_path: &Path,
record: &crate::automation::run_ledger::AutomationRunLedgerRecord,
)
| 704 | |
| 705 | #[cfg(unix)] |
| 706 | fn scheduler_record_log_fields( |
| 707 | project_path: &Path, |
| 708 | record: &crate::automation::run_ledger::AutomationRunLedgerRecord, |
| 709 | ) -> Vec<(&'static str, String)> { |
| 710 | use crate::automation::run_ledger::AutomationRunStatus; |
| 711 | |
| 712 | let outcome = match record.status { |
| 713 | AutomationRunStatus::Succeeded => "complete", |
| 714 | AutomationRunStatus::Failed => "error", |
| 715 | AutomationRunStatus::Skipped => "skipped", |
| 716 | AutomationRunStatus::Queued => "queued", |
| 717 | AutomationRunStatus::Running => "running", |
| 718 | }; |
| 719 | let task = record |
| 720 | .task_key |
| 721 | .as_deref() |
| 722 | .unwrap_or_else(|| crate::automation::backend::task_key(record.task)) |
| 723 | .to_string(); |
| 724 | let mut fields = vec![ |
| 725 | ("project", project_path.display().to_string()), |
| 726 | ("task", task), |
| 727 | ("outcome", outcome.to_string()), |
| 728 | ("run_id", record.run_id.clone()), |
| 729 | ]; |
| 730 | if let Some(reason) = record.fallback_status.as_ref().or(record.error.as_ref()) { |
| 731 | fields.push(("reason", reason.clone())); |
| 732 | } |
| 733 | fields |
| 734 | } |
| 735 | |
| 736 | #[cfg(all(unix, test))] |
| 737 | fn daemon_scheduler_record_log_line( |
no test coverage detected