Skip to content

Commit

Permalink
Fix stacklevel for TaskContextLogger (apache#39142)
Browse files Browse the repository at this point in the history
Previously it would show the message as coming from context logger module and not the actual call site.
  • Loading branch information
dstandish authored Apr 23, 2024
1 parent bcbcb8e commit acc2338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/utils/log/task_context_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _log(self, level: int, msg: str, *args, ti: TaskInstance):
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
)
Expand Down

0 comments on commit acc2338

Please sign in to comment.