Replace log dict toggles with logdiff kwarg and kanta.transaction.diff logger

Per-transaction logdiff=False skips building and printing the diff body,
logging only the header. Globally, configure_logging(diff=False) disables
the kanta.transaction.diff child logger, which now carries all diff lines,
so applications can route or silence diffs separately from headers.
This commit is contained in:
Leo Vasanko
2026-08-07 01:26:50 +00:00
parent 9e19a1bf21
commit e42f81f44f
7 changed files with 132 additions and 110 deletions
+6 -2
View File
@@ -215,8 +215,12 @@ def resolve_user_key(value: str) -> str | None:
- `kanta.transaction(..., extra="...")` accepts a display-only string that is
appended after the action in the header (colored by Kanta); it is never
persisted in the `ChangeRecord`.
- The header and diff parts can be toggled independently per transaction:
`kanta.transaction(..., log={"header": True, "diff": False})`.
- `kanta.transaction(..., logdiff=False)` skips building and printing the diff
body and logs only the header, which is useful for large or noisy
changesets. Diff output can also be disabled globally with
`configure_logging(diff=False)`; diff lines are emitted on the
`kanta.transaction.diff` child logger so applications can route or silence
them separately from the headers.
## Migrations