Skip to content

Add colored console output for agent logs #330

@bhouston

Description

@bhouston

Add colored console output for agent logs

Description

Currently, console output for agents and their tools is colored based on log level (error, warn, info, debug), but there's no way to visually distinguish between different agents and their tools. This makes it difficult to follow the execution flow when multiple agents are running in parallel.

Proposed Solution

Modify the consoleOutputLogger function to assign a unique color to each agent, and have tools inherit their parent agent's color. This will make it easier to follow the execution flow of each agent and its tools in the console.

  • Each agent should be assigned a random color when created
  • Tools should inherit their parent agent's color
  • Error and warning messages should still be red and yellow respectively, as these colors should be reserved for indicating severity
  • The color should be stored in the Logger class and used when outputting messages to the console

Benefits

  • Improved readability of console output
  • Easier to track the execution flow of multiple agents and their tools
  • Better visual distinction between different agents

Implementation Details

  • Add a color property to the Logger class
  • Modify the consoleOutputLogger function to use the agent's color for output
  • Generate random colors for agents in the agentStart tool
  • Have tools inherit their parent's color

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions