| 480 | |
| 481 | |
| 482 | def build_debug_report( |
| 483 | *, |
| 484 | recorder: InMemoryDebugRecorder | None, |
| 485 | libraries: Iterable[LibrarySpec | str] | None = None, |
| 486 | executables: Iterable[ExecutableSpec | str] | None = None, |
| 487 | include_module_paths: bool = False, |
| 488 | include_executable_paths: bool = True, |
| 489 | log_limit: int = 300, |
| 490 | ) -> str: |
| 491 | logs_text = recorder.render_text(limit=log_limit) if recorder is not None else "<debug recorder unavailable>" |
| 492 | |
| 493 | sections = collect_debug_sections( |
| 494 | libraries=libraries, |
| 495 | executables=executables, |
| 496 | include_module_paths=include_module_paths, |
| 497 | include_executable_paths=include_executable_paths, |
| 498 | ) |
| 499 | |
| 500 | return format_debug_report( |
| 501 | sections=sections, |
| 502 | logs_text=logs_text, |
| 503 | ) |
| 504 | |
| 505 | |
| 506 | def collect_runtime_summary() -> dict[str, str]: |