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/12/24 08:37:45 UTC

[GitHub] [airflow] dstandish opened a new pull request, #28571: WIP - Don't disable propagation or walk logger tree with set_context

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

   After https://github.com/apache/airflow/pull/28440, instead of having a task logger both at `airflow.task` and root logger, we only have it at root logger.  This means we can remove the logic to set propagate=False, because there's no longer a risk of record processed by FTH twice.  It also means we can remove the logic to walk up the logger hierarchy and set context because we don't need to hit both airflow.task and root -- there will only ever be one such handler instance.


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


[GitHub] [airflow] github-actions[bot] closed pull request #28571: Simplify log context setting / propagation handling

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #28571: Simplify log context setting / propagation handling
URL: https://github.com/apache/airflow/pull/28571


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


[GitHub] [airflow] dstandish commented on a diff in pull request #28571: Simplify log context setting / propagation handling

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on code in PR #28571:
URL: https://github.com/apache/airflow/pull/28571#discussion_r1089653695


##########
airflow/utils/log/logging_mixin.py:
##########
@@ -218,24 +224,14 @@ def set_context(logger, value):
     :param logger: logger
     :param value: value to set
     """
-    while logger:
-        orig_propagate = logger.propagate
+    if value is not None:

Review Comment:
   The changes in this function are mainly what this PR is about.  We no longer need to "walk" the logger hierarchy because we no longer duplicate task logging handlers.
   
   And as a result we no longer need to disable propagation by default, so we can revert back to the prior approach of just disabling when explicitly asked to do so.



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


[GitHub] [airflow] github-actions[bot] commented on pull request #28571: Simplify log context setting / propagation handling

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28571:
URL: https://github.com/apache/airflow/pull/28571#issuecomment-1472925084

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #28571: Simplify log context setting / propagation handling

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #28571:
URL: https://github.com/apache/airflow/pull/28571#discussion_r1090159560


##########
airflow/utils/log/logging_mixin.py:
##########
@@ -32,15 +32,22 @@
 ANSI_ESCAPE = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]")
 
 
-# Private: A sentinel objects
+# Private: Sentinel objects
 class SetContextPropagate(enum.Enum):
-    """:meta private:"""
+    """
+    Deprecated.  Previously used to allow disabling of propagation (the default) of

Review Comment:
   Since this is a private class, can we remove this outright?



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