This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch v2-9-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit e4a4e2daf55455f2c664999231f413ae0e185b7e Author: Daniel Standish <[email protected]> AuthorDate: Mon Apr 22 20:02:45 2024 -0700 Fix stacklevel for TaskContextLogger (#39142) Previously it would show the message as coming from context logger module and not the actual call site. (cherry picked from commit acc2338aed8d789503dca7fba262b326eeb5c117) --- airflow/utils/log/task_context_logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/utils/log/task_context_logger.py b/airflow/utils/log/task_context_logger.py index 07a5ed74e8..61cecfd92f 100644 --- a/airflow/utils/log/task_context_logger.py +++ b/airflow/utils/log/task_context_logger.py @@ -101,7 +101,7 @@ class TaskContextLogger: task_handler.set_context(ti, identifier=self.component_name) if hasattr(task_handler, "mark_end_on_close"): task_handler.mark_end_on_close = False - filename, lineno, func, stackinfo = logger.findCaller() + filename, lineno, func, stackinfo = logger.findCaller(stacklevel=3) record = logging.LogRecord( self.component_name, level, filename, lineno, msg, args, None, func=func )
