windows-drivers-rs icon indicating copy to clipboard operation
windows-drivers-rs copied to clipboard

Move `cargo-wdk` output to stderr

Open gurry opened this issue 3 months ago • 2 comments

cargo build, rustc and other build tools like gcc emit their human readable output to to stderr instead of stdout. This allows stdout to be available for machine readable output (e.g. cargo build --message-format=json). I believe we should move cargo wdk output to stderr as well.

The rationale is:

  • Using stderr is consistent with the aforementioned convention for build tools
  • Without it you could end up "splitting" the output when stdout or stderr is redirected to a file. E.g. if you run cargo wdk build > output.log then all the cargo wdk lines will go to the file and all the Compiling ... lines from cargo build will appear on the console and not go into the file. We need to use the same stream as cargo to avoid this.
  • It leaves the door open for supporting machine-readable output in the future

gurry avatar Oct 04 '25 02:10 gurry

Working on this!

cnaples79 avatar Oct 07 '25 12:10 cnaples79

PR submitted for this issue.

cnaples79 avatar Oct 07 '25 21:10 cnaples79