Skip to content

Commit c90be88

Browse files
committed
env_run: fold argv into result logs, drop pre-run debug line
The pre-run `logger.debug("env-run: %s", argv)` was redundant on the success path (every successful call produced two debug lines for the same command). Move the argv into the post-run logs so each run produces exactly one log line, with the full command alongside the captured streams. The pre-run log's only unique value was surviving the `check=True → CalledProcessError` path, but `CalledProcessError` already carries `cmd`, `returncode`, `stdout`, and `stderr`, so any caller that handles the exception has access to the same information.
1 parent c54bdfb commit c90be88

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

arc/job/env_run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,16 @@ def run_in_conda_env(
122122
"python", script_path,
123123
*script_args,
124124
]
125-
logger.debug("env-run: %s", " ".join(argv))
126125
result = subprocess.run(argv, check=check, capture_output=True, text=True)
127126
if result.returncode:
128127
logger.warning(
129-
"env-run: %s exited with %d\nstdout:\n%s\nstderr:\n%s",
130-
script_path, result.returncode, result.stdout, result.stderr,
128+
"env-run: %s exited with %d\ncmd: %s\nstdout:\n%s\nstderr:\n%s",
129+
script_path, result.returncode, " ".join(argv),
130+
result.stdout, result.stderr,
131131
)
132132
else:
133133
logger.debug(
134-
"env-run: %s exited 0\nstdout:\n%s\nstderr:\n%s",
135-
script_path, result.stdout, result.stderr,
134+
"env-run: %s exited 0\ncmd: %s\nstdout:\n%s\nstderr:\n%s",
135+
script_path, " ".join(argv), result.stdout, result.stderr,
136136
)
137137
return result

0 commit comments

Comments
 (0)