fcbf1393f5
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
14 lines
465 B
Python
14 lines
465 B
Python
"""Structured log-event telemetry (SD-0002 §9.1). One JSON object per event on the
|
|
`ecomm.telemetry` logger — counts and durations only; never file names, URLs,
|
|
catalog content, or secret bytes (§6.3-handbook)."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import logging
|
|
|
|
_logger = logging.getLogger("ecomm.telemetry")
|
|
|
|
|
|
def emit(event: str, **fields: object) -> None:
|
|
_logger.info(json.dumps({"event": event, **fields}, sort_keys=True, default=str))
|