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)
| 1552 | /// command's `cwd` already names), without its capture token, which |
| 1553 | /// authenticates operation linkage, and with long lists cut short. |
| 1554 | fn log_evidence<T: Serialize>(record: &T) { |
| 1555 | if !tracing::enabled!(target: HOOK_EVIDENCE_LOG_TARGET, tracing::Level::INFO) { |
| 1556 | return; |
| 1557 | } |
| 1558 | let Ok(serde_json::Value::Object(fields)) = serde_json::to_value(record) else { |
| 1559 | return; |
| 1560 | }; |
| 1561 | tracing::info!( |
| 1562 | target: HOOK_EVIDENCE_LOG_TARGET, |
| 1563 | evidence = %serde_json::Value::Object(loggable_evidence(fields)), |
| 1564 | "journaled Git hook evidence" |
| 1565 | ); |
| 1566 | } |
| 1567 | |
| 1568 | fn loggable_evidence( |
| 1569 | mut fields: serde_json::Map<String, serde_json::Value>, |
no outgoing calls
no test coverage detected