Commit c7ddc85
committed
fix: prefix external command output for better log clarity
Most log output uses the package name as a prefix (via FromagerLogRecord)
so it is possible to tell which package is being processed when a message
is logged. However, the output of external commands (like uv) was logged
without any visual indication that it came from an external command rather
than fromager itself, making logs harder to read.
This fix adds a visual prefix (' > ') to each line of external command
output using str.replace(), then logs the entire output in a single call.
Benefits:
- Visual clarity: The '> ' prefix clearly distinguishes external command
output from fromager's own log messages
- Parallel builds: Logging the entire output as one block prevents line
interleaving when building multiple packages in parallel
- Package context: The package name prefix is still applied to the whole
output block via FromagerLogRecord
- Simple implementation: Uses a single str.replace() call
Example output:
numpy: command failed with exit code 1: uv pip install numpy
numpy: > Resolving dependencies...
> Error: Could not find package
Fixes: #753
Co-authored-by: Claude <claude@anthropic.com>
Signed-off-by: Ioannis Angelakopoulos <iangelak@redhat.com>1 parent 222f3f8 commit c7ddc85
2 files changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
117 | 130 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
0 commit comments