Forum How do I...?

Not log fin|success after each pdf run

levi.lewis
Our development team is using Prince 12.2 with Princely 2.1.0 for a Rails project.

In our rspec test suite, we're testing that various PDFs are being generated. After each PDF is created, our test output is interrupted by the "fin|success" message, indicating that the PDF has completed.

We'd like to find a way to have this output not occur if at all possible. Looking at the Princely code in pdf.rb, it looks like Prince should be called silently, but fin|success is still being outputted.
/usr/local/bin/prince --input=html --server --log=path/to/prince.log  --silent - -o -


We are calling Princely using the command:
Princely::Pdf.new(server_flag: true).pdf_from_string(html)


Any help would be appreciated. Thanks!
  1. Rspec Output.png25.7 kB
mikeday
The --server --silent options (which have been replaced with --structured-log=quiet) are intended to suppress error and warning messages during conversion, but the final status is still emitted for the calling process to read.

If Princely does not read this final status, perhaps it should simply redirect it to /dev/null? But it would be better to return some indication of whether conversion has succeeded or failed.
levi.lewis
It looks like the original intent on Princely was for it to not display any output for Prince, so that would make it more consistent with how it was behaving before. I do, however, like the idea of having the option to have Princely show/hide the fin status.