Log
message: String, object, array, or Pydantic model to logerror(optional): Iftrue, log as error leveldebug(optional): Iftrue, only log to console (skip backend)
success(boolean): Whether the log was senterror(string | null): Error message if sending failed
Notes
- To ensure a good user experience, make sure that any logs which do not have
debug=Trueare clean and concise. - Objects and arrays are pretty-printed in the console and serialized to JSON strings when sent to the backend.
- Pydantic models (Python) are automatically converted via
.model_dump()before serialization.
See Also
- Error Handling — Log errors with
error: trueso they appear in the UI - Agent Context — All SDK methods available on the agent object