dheerajturaga opened a new pull request, #68598:
URL: https://github.com/apache/airflow/pull/68598

   CLI commands that accept -o (table|json|yaml|plain) write structured data to 
stdout. Airflow's default logging config routes the root console handler to 
sys.stdout, so any log line emitted while such a command runs is mixed into 
that data and breaks downstream parsers (most visibly: the Celery default 
visibility_timeout warning corrupts `airflow celery list-workers -o json` 
output).
   
   After parse_args() in the CLI entrypoint, redirect any root-logger 
StreamHandler whose stream is sys.stdout to sys.stderr, gated on hasattr(args, 
'output'). Daemon commands (scheduler, api-server, celery worker, ...) do not 
register -o and so keep their existing stdout-logging behavior.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, 
please
   change below checkbox to `[X]` followed by the name of the tool, uncomment 
the "Generated-by".
   -->
   
   - [ ] Yes (please specify the tool below)
   Claude Code Opus 4.7
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to