All code at
list[tuple[datetime, Level, str]]
[
(datetime(...), 'info', 'GET /accounts/invoice/ -> 200'),
(datetime(...), 'info', 'GET /add-on/complete/ -> 200'),
(datetime(...), 'error', 'Stripe payment failed, insuff...'),
(datetime(...), 'warning', 'POST /payments/42/complete/ -> 400'),
(datetime(...), 'warning', 'POST /payments/37/complete/ -> 400'),
(datetime(...), 'debug', 'Slow query detected SELECT...'),
]
This is what code looked like...
until about 1980
class Log(TypedDict):
start: datetime
end: datetime | None
message: str
attributes: dict[str, Any] | None
children: list[Log] | None
list[Log]
What we proposing here isn't new, but it's still not available to most developers
[
Log(
start=datetime(...),
end=datetime(...),
message='POST /payments/42/complete/ -> 400',
children=[
Log(
start=datetime(...),
message='Stripe payment failed, insuff...',
attributes={'reason': 'insufficent funds', ...}
),
]
)
]
Simple to get started
Built on Open Telemetry
Customised for Python
But Usable with any Language
Traces as Logs, and Metrics
Auto-tracing
Structured Data