v0.4.0 — events API safety
Makes the typed-events API safe to recommend for high-value and error-path events. Fully additive at call sites; one prod-mode behavior change (lenient mode no longer drops events).
uv add "git+https://github.com/collide-ai/collide-logging-py.git@v0.4.0"Fixed
- #36 — lenient mode no longer discards the offending event. Under
COLLIDE_LOG_VALIDATE=lenienta violation previously dropped the whole payload and emitted only a meta-event — events vanished during incidents. Now the event is emitted best-effort under its real name (unknown fields dropped, known fields redacted, a_schema_violationmarker added), with thecollide_logging.schema_violationmeta-event alongside as an alertable signal.raisemode unchanged.
Added
- #33 —
CollideLogger.event()acceptslevel=andexc_info=. Schema-validated error-path events can emit atwarning/error/etc. and carry a traceback. Defaults leave the happy-path record byte-identical. - #35 — public
digest_value(). Exposes the{"len", "sha256"}digest behindFieldSpec(redact=True)for hand-curated redaction of sensitive free-text on the plainlog.info(...)path. Auto-redaction remains name-based only.
Upgrading
No call-site changes required. Services on lenient should confirm an alert on event="collide_logging.schema_violation". Avoid declaring an event field named _schema_violation — now reserved.
Follow-up: #37 (unrecognized COLLIDE_LOG_VALIDATE values fall back to raise-mode).