-
Notifications
You must be signed in to change notification settings - Fork 33
Fix logging to a file with bashlib based processors #1123
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
Conversation
kba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why the STDERR/STDOUT redirection context manager does not work for the run_cli method as well?
But if it fixes the problem, then let's run with it.
What do you mean with the bulk-add issue? Do you mean the --mets-server-url argument for the bashlib processors?
Because
There was the |
Maybe there is a way to make it work without the extra redirection to file inside the EDIT: There is a way indeed. The problem was that the |
|
olena-binarize runs. The changes are reflected to the mets file locally but not to the mets server. Hence, the next processor fails to find the required data: Traceback (most recent call last):
File "/home/mm/Desktop/core/ocrd_network/ocrd_network/process_helpers.py", line 45, in invoke_processor
log_level='DEBUG'
File "/home/mm/Desktop/core/ocrd/ocrd/processor/helpers.py", line 134, in run_processor
raise err
File "/home/mm/Desktop/core/ocrd/ocrd/processor/helpers.py", line 131, in run_processor
processor.process()
File "/home/mm/venv37-ocrd/lib/python3.7/site-packages/ocrd_anybaseocr/cli/ocrd_anybaseocr_cropping.py", line 763, in process
for (n, input_file) in enumerate(self.input_files):
File "/home/mm/Desktop/core/ocrd/ocrd/processor/base.py", line 291, in input_files
ret = self.zip_input_files(mimetype=None, on_error='abort')
File "/home/mm/Desktop/core/ocrd/ocrd/processor/base.py", line 359, in zip_input_files
raise ValueError(msg)
ValueError: Could not find any files for --page-id PHYS_0007 - compare 'PHYS_0007' with the output of 'orcd workspace list-page'.@kba, do you have ideas? |
|
I think this is the reason, as we discussed in our VC. It is not urgent to make bashlib processors work, however, we may want to keep a separate issue for that and merge this PR. |
If ocrd-olena-binarize is not using the METS server but writing to the METS file directly, then the OcrdMets of METS server is out of date. AFAICT we don't currently have an endpoint to do So we either add such a |
This PR fixes the logging errors of type:
EDIT: Forcing InitLogging() just for Python processors but not for bashlib processors was the simple fix.