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


##########
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:

Review Comment:
   ```suggestion
               if set_context and set_context(value) is DISABLE_PROPOGATE:
   ```
   



##########
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:
+                    logger.propagate = False

Review Comment:
   ```suggestion
                   logger.propagate = False
   ```
   



-- 
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