Skip to main content

Logging

Agentium includes a built-in Logger with colored terminal output and structured agent run formatting. Control verbosity via logLevel in AgentConfig.

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" — Logs tool calls, arguments, and results (verbose).
  • "info" — Logs 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: tool name and result preview (truncated).
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", additional lines appear for each tool call:

Example: Enabling Logging