Skip to content

fix: send async logger output to stderr#1971

Open
nightcityblade wants to merge 1 commit into
unclecode:mainfrom
nightcityblade:fix/issue-1968
Open

fix: send async logger output to stderr#1971
nightcityblade wants to merge 1 commit into
unclecode:mainfrom
nightcityblade:fix/issue-1968

Conversation

@nightcityblade
Copy link
Copy Markdown

Summary

Fixes #1968

Routes AsyncLogger console output to stderr by default so stdout remains clean for stdio protocols such as MCP, while still allowing callers to pass a custom Rich console.

List of files changed and why

  • crawl4ai/async_logger.py - Default logger console output to stderr and add an optional custom console parameter.
  • tests/loggers/test_async_logger_stderr.py - Cover stderr default behavior and custom console override.

How Has This Been Tested?

  • . .venv/bin/activate && python -m pytest tests/loggers/test_async_logger_stderr.py

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] AsyncLogger writes to stdout, breaking MCP stdio transport

1 participant