Fix custom logger conflicts with CrewAI verbose logging (#3197) #3198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix custom logger conflicts with CrewAI verbose logging (#3197)
Summary
This PR fixes issue #3197 where custom Python loggers don't work when CrewAI's
verbose=True
is enabled. The problem occurred because Rich's Live console formatter captures stdout/stderr when active, preventing custom logger output from being displayed.Root Cause: The
ConsoleFormatter.print()
method wasn't properly pausing Rich Live sessions when printing non-Tree content (like custom logger output), causing the output to be suppressed.Solution: Modified the print method to temporarily pause the Live session when printing non-Tree content, print the content normally (allowing custom loggers to work), then resume the Live session.
Review & Testing Checklist for Human
verbose=True
and custom Python loggers to ensure logging output appears correctlyRecommended Test Plan:
logging
moduleverbose=False
- custom logs should appearverbose=True
- custom logs should still appear alongside CrewAI's live formattingDiagram
Notes
__rich_console__
method)Link to Devin run: https://app.devin.ai/sessions/2efed7ad99014cfda6649c9b2cb6a700
Requested by: João ([email protected])