How to handle logs interleaving with Hurl progress bar
Current Hurl overwrites the previous line when it writes its progress bar (relevant code here: https://github.com/Orange-OpenSource/hurl/blob/4cf44ffe0c12a0bd3755f0ba21f5883f388e9692/packages/hurl/src/util/term.rs#L189-L202). This allows it to "progress" the progress bar.
The problems comes when another process logs to the same output.
We use Hurl for our testing (which is great btw -- well done!), but it will overwrite any of the application log which we log to standard out/error by default. Currently we work around this by logging our service logs to a separate file and hope we don't have to look at :) (i.e. no errors happen). But this is less than ideal.
Are there any better solutions for this?
Hi @Thomasdezeeuw
With --test, there is currently no explicit way of disabling progress bar. As a workaround, you can either pipe Hurl's stderr to a file (that will disable progress bar), or declare an env var "CI" that will also disable progress bar to be drawn. That said, we plan to add an explicit --progress-bar option to force display of progress bar, we can also add a --no-progress-bar to explicitly disable it.
Thanks for the response @jcamiel. It's not so much about disabling the progress bar, although that would solve the issue, it's more about it not overwriting the log output.
For a bit more context, when running our tests we expect zero logs from our services as we only log errors. But if a test does fail the log from our service is now (partially) overwritten. The progress bar is quite useful when actively working on the code & running the tests in parallel.
So basically I'm asking for "don't overwrite if another process wrote the previous output", which I don't think is possible. I was wondering if anyone found a better work around than logging to a separate file.