You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jedcunningham (via GitHub)" <gi...@apache.org> on 2025/03/12 19:01:58 UTC

Re: [PR] Use structlog for GitDagBundle [airflow]

jedcunningham commented on code in PR #47685:
URL: https://github.com/apache/airflow/pull/47685#discussion_r1992127381


##########
airflow/dag_processing/bundles/git.py:
##########
@@ -154,33 +153,23 @@ def __init__(
         self.git_conn_id = git_conn_id
         self.repo_url = repo_url
 
-        def log_debug(msg, **kwargs):
-            if not log.isEnabledFor(logging.DEBUG):
-                return
-            # ugly; replace when structlog implemented
-            context = dict(
-                bundle_name=self.name,
-                version=self.version,
-                bare_repo_path=self.bare_repo_path,
-                repo_path=self.repo_path,
-                versions_path=self.versions_dir,
-                git_conn_id=self.git_conn_id,
-                repo_url=self.repo_url,
-            )
-            context.update(kwargs)
-
-            for k, v in context.items():
-                msg += f" {k}='{v}'"
-            log.debug(msg)
-
-        self._log_debug = log_debug
-        log_debug("bundle configured")
+        self._log = log.bind(

Review Comment:
   Why not just "self.log"?



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