elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

Print errors to stderr instead of stdout #70

Closed rtfeldman closed 8 years ago

rtfeldman commented 8 years ago

In elm-test we generate a temporary .js file for the compiled Test.elm before running the tests.

By default that means we get output like this every time the tests run:

Successfully generated /var/folders/f2/bgdp00xs327b2qx7mmg6jkbh0000gn/T/elm_test_1151022-3235-1bxa84u.js
Successfully compiled Test.elm

This is pretty ugly, so what we've been doing is piping elm-make's stdout and discarding lines that start with "Success". This works, but introduces a new problem: because we're piping the output instead of just giving elm-make direct access to the console, we miss out on colorized error messages. (Thanks @evancz for pointing out the culprit!)

If elm-make wrote error messages to stderr and success messages to stdout, we could continue to pipe the stdout stream for filtering, but let stderr pass through as normal (colors and all), meaning everything would be rad and awesome!

itrelease commented 8 years ago

@rtfeldman can you provide example for your case so I can reproduce your problem?

rtfeldman commented 8 years ago

Sure, just take a look at https://travis-ci.org/rtfeldman/node-elm-test - it currently works as described above. :smiley:

itrelease commented 8 years ago

@rtfeldman that was fast :+1: thanks

jvoigtlaender commented 8 years ago

On the other hand, https://github.com/elm-lang/elm-make/pull/32 argues that the success messages should go to stderr as well.

rtfeldman commented 8 years ago

True, but it argues that based on an explicitly unsupported motivating use case. I commented over there.

evancz commented 8 years ago

Tracked in #98