Skip to main content
All examples route user-facing output to stdout and SDK internal logs to stderr. Control verbosity with LOG_LEVEL without changing code. Source: examples/logs/

Output routing

OutputDestination
User prompt and assistant replystdout
SDK internal logsstderr

Usage

From examples/:
LOG_LEVEL=debug go run ./simple_agent "Hello"
go run ./simple_agent "Hello" 2>debug.log
go run ./simple_agent "Hello" 2>/dev/null   # suppress SDK logs
VariableDefaultDescription
LOG_LEVELerrordebug, info, warn, error
Optional run footers: SHOW_LLM_USAGE=true, SHOW_TELEMETRY=true — see Running Examples. For OTLP log export, see Observability. For file logging in the REPL, see CLI.

Learn more

Logs

SDK logging and OTLP export

Telemetry

Per-run telemetry footers