mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Enhance Event Listener with Rich Visualization and Improved Logging (#2321)
* Enhance Event Listener with Rich Visualization and Improved Logging * Add verbose flag to EventListener for controlled logging * Update crew test to set EventListener verbose flag * Refactor EventListener logging and visualization with improved tool usage tracking * Improve task logging with task ID display in EventListener * Fix EventListener tool branch removal and type hinting * Add type hints to EventListener class attributes * Simplify EventListener import in Crew class * Refactor EventListener tree node creation and remove unused method * Refactor EventListener to utilize ConsoleFormatter for improved logging and visualization * Enhance EventListener with property setters for crew, task, agent, tool, flow, and method branches to streamline state management * Refactor crew test to instantiate EventListener and set verbose flags for improved clarity in logging * Keep private parts private * Remove unused import and clean up type hints in EventListener * Enhance flow logging in EventListener and ConsoleFormatter by including flow ID in tree creation and status updates for better traceability. --------- Co-authored-by: Brandon Hancock <brandon@brandonhancock.io> Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
@@ -33,6 +33,7 @@ from crewai.utilities.events.crew_events import (
|
||||
CrewTestCompletedEvent,
|
||||
CrewTestStartedEvent,
|
||||
)
|
||||
from crewai.utilities.events.event_listener import EventListener
|
||||
from crewai.utilities.rpm_controller import RPMController
|
||||
from crewai.utilities.task_output_storage_handler import TaskOutputStorageHandler
|
||||
|
||||
@@ -862,6 +863,9 @@ def test_crew_verbose_output(capsys):
|
||||
# Now test with verbose set to False
|
||||
crew.verbose = False
|
||||
crew._logger = Logger(verbose=False)
|
||||
event_listener = EventListener()
|
||||
event_listener.verbose = False
|
||||
event_listener.formatter.verbose = False
|
||||
crew.kickoff()
|
||||
captured = capsys.readouterr()
|
||||
filtered_output = "\n".join(
|
||||
|
||||
Reference in New Issue
Block a user