Add 'task:' label to exception handler log messages (#158674)

This commit is contained in:
Paul Tarjan
2025-12-14 15:55:13 -07:00
committed by GitHub
parent c3f743cafd
commit 9b56759c1e

View File

@@ -227,7 +227,7 @@ def _async_loop_exception_handler(
if source_traceback := context.get("source_traceback"):
stack_summary = "".join(traceback.format_list(source_traceback))
logger.error(
"Error doing job: %s (%s): %s",
"Error doing job: %s (task: %s): %s",
context["message"],
context.get("task"),
stack_summary,
@@ -236,7 +236,7 @@ def _async_loop_exception_handler(
return
logger.error(
"Error doing job: %s (%s)",
"Error doing job: %s (task: %s)",
context["message"],
context.get("task"),
**kwargs, # type: ignore[arg-type]