Skip to content

[Agent] Implement logging system #23

@kox13

Description

@kox13

Goal

Implement a unified, high-performance logging system for the Volta Agent using the spdlog library. This system will replace legacy print statements, providing better diagnostic capabilities through log levels, structured formatting, and configurable outputs (stderr/file).

Acceptance criteria

  • [cite_start]All agent modules use the uniform logging API (spdlog); no std::cerr, printf, or fprintf remain in production code.
  • [cite_start]Minimum log level is configurable via runtime configuration ([Agent] Implement runtime configuration mechanism (CLI args & Env vars) #18), defaulting to INFO.
  • [cite_start]Log format is standardized and includes: timestamp (millisecond precision), log level, module tag, and message.
  • [cite_start]Logs are routed to stderr by default, with an optional output to a file featuring a 10 MB rotation policy.
  • [cite_start]Unit tests verify correct log level filtering (e.g., WARN level does not output DEBUG messages) and format compliance.

🛠️ Sub-tasks & Scope of work

  • T23-1: Library Integration: Integrate the spdlog library via vcpkg. [cite_start]Define the supported log levels (TRACE, DEBUG, INFO, WARN, ERROR) and link the minimum log level to the runtime configuration mechanism from [Agent] Implement runtime configuration mechanism (CLI args & Env vars) #18.
  • T23-2: Format & Sink Setup: Define the standard log format: [YYYY-MM-DD HH:MM:SS.mmm] [LEVEL] [module] message. [cite_start]Configure sinks for stderr and an optional file sink with a 10 MB rotation limit.
  • [cite_start]T23-3: Codebase Refactoring: Systematically replace all instances of std::cerr, fprintf, and printf across all agent modules with appropriate spdlog calls, ensuring correct level assignment and module tagging.
  • [cite_start]T23-4: Unit Testing: Implement unit tests to ensure level filtering works as expected and that the generated output contains all required metadata (timestamp, level, module).

Deliverables

  • Logging module integrated into the Agent's core.
  • Refactored agent source code using the new API.
  • Unit test suite for log validation.
  • Updated configuration documentation regarding log level settings.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions