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

Function log_evidence

atomic-cli/src/commands/git/hooks.rs:1554–1566  ·  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

1552/// command's `cwd` already names), without its capture token, which
1553/// authenticates operation linkage, and with long lists cut short.
1554fn 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
1568fn loggable_evidence(
1569 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