Skip to content

feat: add structured logging #45

Description

@assapir

Problem

Golem currently uses println!/eprintln! for all output — user-facing messages, debug info, warnings, and errors are all mixed together with no log levels, timestamps, or filtering.

Proposed solution

Add structured logging via the tracing crate (or log + env_logger for simplicity).

What to log

Level Examples
error API failures, auth errors, tool execution failures
warn Parse retries, deprecated features, fallback behavior
info Model changes, login/logout, tool execution summaries
debug Full API request/response bodies, ReAct loop iterations, memory operations
trace Raw HTTP headers, token refresh flow, config reads

Configuration

Implementation

  • Add tracing + tracing-subscriber dependencies
  • Replace eprintln!("warning: ...") with tracing::warn!()
  • Add structured fields to log events (provider, model, iteration, tool name)
  • Keep user-facing output (println!) separate from logs
  • Logs go to stderr, user output to stdout

Relates to

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions