Skip to main content

In plain terms

logLevel is how chatty the agent is in your terminal.
  • "silent" (default) — hush
  • "info" — “run started / ended”
  • "debug" — also print tool calls

Logger Class

The Logger is used internally by agents. You can also instantiate it directly:

LogLevel


Setting logLevel in AgentConfig

Control agent logging with the logLevel property:
  • "debug" — Full tool names, arguments, and results (JSON pretty-printed, not sliced at 200 chars).
  • "info" — Agent start, output, token usage, and duration.
  • "silent" — No logs (default).

What Gets Logged

When a run begins: agent name and input preview.
At debug level: tool name and arguments.
At debug level: full tool result. JSON strings are pretty-printed. Bodies over 100k characters end with … (N more chars) instead of a silent mid-JSON cut.
At info level: prompt tokens, completion tokens, total tokens.
At info level: wall-clock duration (ms or seconds).
When a run completes: output preview and summary.

LoggerConfig


Colored Terminal Output

The logger uses ANSI escape codes for colored output:
  • Cyan — Agent name, box borders
  • Magenta — Tool names
  • Green — Token counts, success indicators
  • Yellow — Duration, string values
  • Gray — Timestamps, metadata
  • Red — Errors
Box-drawing characters (┌, │, └, ─) create a structured layout for agent runs.

Example Output

With logLevel: "info":
With logLevel: "debug", each tool is two compact lines — args stay on one line when small, pretty-printed when not:

Example: Enabling Logging