Files
repo-scoping/src/repo_registry/core/logging.py

16 lines
330 B
Python

from __future__ import annotations
import json
import logging
from typing import Any
LOGGER_NAME = "repo_registry.operations"
def log_operation(event: str, **fields: Any) -> None:
payload = {"event": event, **fields}
logging.getLogger(LOGGER_NAME).info(
json.dumps(payload, sort_keys=True, default=str)
)