Skip to main content

log_record

Function log_record 

Source
pub fn log_record(envelope: &str, mode: Mode) -> Value
Expand description

Build a structured log record for one PreToolUse envelope: which tool ran, its Bash command, the call’s cwd/session_id, and what the hook decided under mode. Unlike process this also records the silent allows — the raw material for spotting shell idioms that should have been steered to ct but currently are not. Lenient: a malformed envelope still yields a record of what could be read. No timestamp is stamped here, so the record stays deterministic; the caller adds the time and appends it as one JSONL line.