You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/29 16:10:04 UTC

[GitHub] [airflow] kaxil commented on a diff in pull request #26779: Ensure the log messages from operators during parsing go somewhere

kaxil commented on code in PR #26779:
URL: https://github.com/apache/airflow/pull/26779#discussion_r983742204


##########
airflow/utils/log/logging_mixin.py:
##########
@@ -179,15 +182,15 @@ def set_context(logger, value):
     :param logger: logger
     :param value: value to set
     """
-    _logger = logger
-    while _logger:
-        for handler in _logger.handlers:
+    while logger:
+        for handler in logger.handlers:
             # Not all handlers need to have context passed in so we ignore
             # the error when handlers do not have set_context defined.
             set_context = getattr(handler, 'set_context', None)
             if set_context:
-                set_context(value)
-        if _logger.propagate is True:
-            _logger = _logger.parent
+                if set_context(value) is DISABLE_PROPOGATE:

Review Comment:
   Should we just chain this "if" with the "if" above?
   
   ```python
   if set_context and set_context(value) is DISABLE_PROPOGATE:
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org