MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / log_evidence

Function log_evidence

atomic-cli/src/commands/git/hooks.rs:1585–1597  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1583/// command's `cwd` already names), without its capture token, which
1584/// authenticates operation linkage, and with long lists cut short.
1585fn 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
1599fn loggable_evidence(
1600 mut fields: serde_json::Map<String, serde_json::Value>,

Callers 1

append_journal_recordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected