MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / _save_cli_log

Function _save_cli_log

scripts/run_dataset.py:256–265  ·  view source on GitHub ↗

Write stdout/stderr from a failed CLI invocation to a log file.

(output_dir: Path, job_name: str, result: subprocess.CompletedProcess)

Source from the content-addressed store, hash-verified

254
255
256def _save_cli_log(output_dir: Path, job_name: str, result: subprocess.CompletedProcess):
257 """Write stdout/stderr from a failed CLI invocation to a log file."""
258 log_path = output_dir / f"{job_name}_cli.log"
259 parts = [
260 f"exit code: {result.returncode}",
261 f"\n--- stdout ---\n{result.stdout}" if result.stdout else "",
262 f"\n--- stderr ---\n{result.stderr}" if result.stderr else "",
263 ]
264 log_path.write_text("\n".join(parts))
265 print(f"Saved CLI log to {log_path}")
266
267
268# ---------------------------------------------------------------------------

Callers 1

run_cliFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected