whatwg/html-build

pdfsizeopt is too verbose

Closed this issue · 9 comments

#126 introduced a problem, namely that the logs are so verbose that Travis doesn't want to load them all. That's because pdfsizeopt is very verbose, but unfortunately it doesn't have a --quiet flag or similar.

@izh1979 @pts, any advice on how to get less verbose output without also hiding errors?

Is it possible to redirect it to a file or to pipe through some filter? E.g. through a sed script that would cut non-errors? (I'm not familiar with Travis and its limitations.)

That would be easy, but unfortunately it looks like even info messages are sent to stderr, so to distinguish we'd have to grep in the output.

It's possible to redirect stderr to stdout by using 2>&1

pts commented

As a workaround, until pdfsizeopt receives a --quiet flag, you can redirect both its stdout and stderr to /dev/null: >/dev/null 2>&1, and rely on the exit code to detect success.

Yeah, I guess that's better, the output is probably rarely interesting, and we can turn it back on if needed for debugging.

Don't we need it if we run into the missing font issue? Let's at least have a follow-up issue (or keep this open) to improve the setup if upstream improves. Of course, we could also continue to rely on manual reports from @izh1979 that we broke PDF output again. 😊

Missing fonts will show up in the prince output, not pdfsizeopt.

pts commented

FYI The newest pdfsizeopt now has a --quiet flag, as requested.

Thanks @pts, I used --v=40 in #130 and looked at the result, very good!