-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library outputs on stderr #56
Comments
Also having |
See also johnwhitington/cpdf-source#59 in cpdf. |
I suggested adding this to
field to Taking a step back it's a bit unclear from the docs what the general error strategy of the library is. It would be nice to have a few words on this either in the module docs and/or more docs in a If I do something simple like reading a file that is not a PDF I find it hard to indicate to end-users that the file is likely not a PDF file. Instead I get is a mix of reports on stderr and an exception with a result totally obscure to any user not acquainted with the PDF file format. For example here reading a (plain text)
Having an error type rather than just a string for communicating errors would make it easier for client of the library to communicate what they find appropriate on different type of errors and devise more user friendly for subset of them. In this particular case knowing that a recovery was attempted and did not succeed I could simply output something like
rather than the above giberish (and possibly have a verbose logging mode that outputs all the hardcore details). |
I have just committed changes to allow redirection of CamlPDF's stderr output via any function. This is done by the new module A proper treatment of this will have to wait to beyond v2.6, but this change at least allows users of the library to prevent output on stderr. |
The library outputs messages on stderr when there are errors which is quite annoying for applications: in general it's better to let applications choose what they want to do with their standard outputs.
Could you maybe output these messages through a log function that can be redefined by the application instead. e.g. in the
Pdfio.input
structure ?The text was updated successfully, but these errors were encountered: