Commit 5fe8328
committed
fix: Redirect the logs from PMD to STDERR when writing to file CF-2115
It seems that when PMD is ran with an output file it logs the info
messages to the STDOUT. But when returning results to the STDOUT
does not do those logs (as most tools)
On the scope of our CLI, we usually propagate a temporary file location
even if we output to the STDOUT, so when such file is propagated to
PMD, we need to make sure to redirect the STDOUT to STDERR
Example
```
Processing files 0% [ ] 0/2 (0:00:00) Violations:0, Errors:0^MProcessing files 50% [========= ] 1/2 (0:00:00) Violations:0, Errors:0^MProcessing files 100% [==================] 2/2 (0:00:00) Violations:0, Errors:1^MProcessing files 100% [==================] 2/2 (0:00:00) Violations:0, Errors:1^MProcessing files 100% [==================] 2/2 (0:00:00) Violations:0, Errors:1
Processing files 100% [==================] 2/2 (0:00:00) Violations:0, Errors:1^MProcessing files 100% [==================] 2/2 (0:00:00) Violations:0, Errors:1
Tool is not installed, installing...
Installing revive using go runtime...
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
```1 parent f0a5bd7 commit 5fe8328
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | | - | |
92 | 96 | | |
93 | | - | |
| 97 | + | |
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| |||
0 commit comments