Log one journaled record without the fields every record repeats (the fixed interpretation text, the format version, and the worktree root the command's `cwd` already names), without its capture token, which authenticates operation linkage, and with long lists cut short.
(record: &T)
| 1583 | /// command's `cwd` already names), without its capture token, which |
| 1584 | /// authenticates operation linkage, and with long lists cut short. |
| 1585 | fn log_evidence<T: Serialize>(record: &T) { |
| 1586 | if !tracing::enabled!(target: HOOK_EVIDENCE_LOG_TARGET, tracing::Level::INFO) { |
| 1587 | return; |
| 1588 | } |
| 1589 | let Ok(serde_json::Value::Object(fields)) = serde_json::to_value(record) else { |
| 1590 | return; |
| 1591 | }; |
| 1592 | tracing::info!( |
| 1593 | target: HOOK_EVIDENCE_LOG_TARGET, |
| 1594 | evidence = %serde_json::Value::Object(loggable_evidence(fields)), |
| 1595 | "journaled Git hook evidence" |
| 1596 | ); |
| 1597 | } |
| 1598 | |
| 1599 | fn loggable_evidence( |
| 1600 | mut fields: serde_json::Map<String, serde_json::Value>, |
no outgoing calls
no test coverage detected