from plato.agents import init_logging, span, log_event, upload_artifacts
# Initialize logging (done automatically by worlds)
init_logging(
callback_url="https://chronos.plato.so/callback",
session_id="session-123",
)
# Create spans for timed operations
async with span("clone_repo") as s:
s.log("Cloning repository...")
# Nested spans automatically track parent-child relationships
async with span("checkout"):
s.log("Checking out branch...")
# Log individual events
await log_event(
span_type="my_event",
content="Something happened",
extra={"key": "value"},
)
# Upload log directory as artifact
await upload_artifacts("/path/to/logs")