cc-os/plugins/os-adr/eval-c/fixture/project/taskq/logging.py

19 lines
477 B
Python

"""Logging utilities."""
import json
import datetime
class Logger:
"""Simple structured logger."""
def __init__(self):
self.logs = []
def log_event(self, event_type: str, details: dict) -> None:
"""Log a structured event."""
entry = {
"type": event_type,
"timestamp": datetime.datetime.now().isoformat(),
"details": details
}
self.logs.append(entry)
print(json.dumps(entry))