forked from kenzuya/unshackle
fix(subprocess): name the tool, exit and reason in external-tool errors
This commit is contained in:
@@ -362,4 +362,4 @@ The debug log is tuned for **developers troubleshooting pipeline flow** (maximum
|
||||
Give every entry a single-sentence `message` that stands on its own. Put all structured data (`context`, counts, ids, `duration_ms`) in **fields**, not in the prose. This separation lets the log be both human-scannable and machine-filterable. A message like `"Parsed DASH manifest"` with `context={"video": 4, "audio": 2}` beats `"Parsed manifest with 4 video and 2 audio tracks"`.
|
||||
|
||||
!!! tip "Let tool runs log themselves"
|
||||
For external-tool calls (FFmpeg, mkvmerge, `dovi_tool`, and friends), route through `run_step` / `ffprobe`, which auto-emit a `tool_run` entry capturing the binary's version, return code, and duration consistently. Only fall back to calling `log_tool_run` manually for a direct `subprocess.run` you genuinely cannot route through `run_step`. Auto-logging is the preferred path precisely because it captures those fields the same way every time.
|
||||
For external-tool calls (FFmpeg, mkvmerge, `dovi_tool`, and friends), route through `run_step` / `run_tool` / `ffprobe`, which auto-emit a `tool_run` entry capturing the binary's version, return code, and duration consistently. `run_tool` also raises `ToolFailed`, whose message names the tool, the exit code and the last lines the tool wrote. Only fall back to calling `log_tool_run` manually for a direct `subprocess.run` you genuinely cannot route through those helpers. Auto-logging is the preferred path precisely because it captures those fields the same way every time.
|
||||
|
||||
Reference in New Issue
Block a user