← Back to issue list

fix(Base): log the output of successful commands as debug.

View original Github issue

Metadata

Project
craft-providers
Number
#951
Type
pull request
State
closed
Author
lengau
Labels
Created
Updated
Closed

Current evaluation

Merged after manual intervention due to repository rule violations. The change resolves issue #250 by logging stdout and stderr of successful commands at the debug level, improving diagnostics without increasing noise in standard runs.

Suggested action:

No scores available.

Issue body

## Reproducer for #250 craft-providers runs many commands inside instances (`apt-get`, `systemctl`, `snap`, etc.) but **never logs their output**, even when running with debug/trace logging. Operators diagnosing problems have to reproduce a full failure to see what a command printed. ### Failing test **`test_execute_run_logs_output_at_debug`** — shows that `_execute_run()` captures stdout via `capture_output=True` but never writes it to the logger. After the command completes successfully, the output is simply discarded. ### Bonus passing test **`test_execute_run_output_included_in_error_details`** — verifies that the *other* half of #250 ("output not shown on error") **already works**: when a subprocess fails, its stdout is preserved on the `CalledProcessError` and included in the `BaseConfigurationError` details via `details_from_called_process_error()`. This serves as a regression guard. ### Fix In `Base._execute_run()`, after `executor.execute_run()` returns successfully, log `proc.stdout` and `proc.stderr` at `logger.debug` level (guarded by a truthiness check so empty output is not logged). Closes #250

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after manual intervention due to repository rule violations. The change resolves issue #250 by logging stdout and stderr of successful commands at the debug level, improving diagnostics without increasing noise in standard runs.
qwen3.6-35b-a3b-mtp-q6
Impact: 30
Quick Win: 25.5
Staleness: 20
Complexity: 15
Confidence: 75
keep open Logs successful command output at debug level to aid debugging. Approved by 2 reviewers, CI mostly passing, blocked by repository rule violation requiring manual merge.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 15
Confidence: 85
needs review Adds debug logging for successful command output in Base._execute_run() to address #250. Includes tests. Approved by 2 reviewers with 2 unresolved comments regarding log verbosity. CI has some failing checks.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 10
Confidence: 85
needs review Adds debug-level logging for successful command output in Base._execute_run() to address issue #250. Includes tests and addresses reviewer questions about log noise. Awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 15
Confidence: 85
needs review Adds debug-level logging for successful command output in Base._execute_run() to fix issue #250. Includes regression tests. Awaiting maintainer review after author clarified logging verbosity concerns.

Update history

Date Change
closed
updated

Related issues

No related issues found above the similarity threshold.