Skip to content
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

Support specific --log-level overrides in ocrd process tasks #604

Open
beckstefan opened this issue Sep 16, 2020 · 3 comments
Open

Support specific --log-level overrides in ocrd process tasks #604

beckstefan opened this issue Sep 16, 2020 · 3 comments
Assignees

Comments

@beckstefan
Copy link

When calling ocrd process with -l DEBUG as parameter to a single process, this gives e.g.

/usr/bin/time -o /home/ocrd/workspace/gue-11660-24-e-1/time docker run --rm -u 1010 -e TESSDATA_PREFIX=/models -v /home/ocrd/workspace/gue-11660-24-e-1:/data -v
 ~/models:/models -w /data -- ocrd/all:maximum ocrd process 'olena-binarize -I OCR-D-IMG -O OCR-D-BIN' \ 'cis-ocropy-deskew -I OCR-D-BIN -O OCR-D-DESKEW' \ 'any
baseocr-crop -I OCR-D-DESKEW -O OCR-D-CROP' \ 'cis-ocropy-segment -I OCR-D-CROP -O OCR-D-PAGE-SEG -l DEBUG -P level-of-operation page' \ 'tesserocr-recognize -I
 OCR-D-PAGE-SEG -O OCR-D-OCR -P model Fraktur'
Traceback (most recent call last):
  File "/usr/bin/ocrd", line 33, in <module>
    sys.exit(load_entry_point('ocrd', 'console_scripts', 'ocrd')())
  File "/usr/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/build/core/ocrd/ocrd/cli/process.py", line 28, in process_cli
    run_tasks(mets, log_level, page_id, tasks, overwrite)
  File "/build/core/ocrd/ocrd/task_sequence.py", line 124, in run_tasks
    tasks = [ProcessorTask.parse(task_str) for task_str in task_strs]
  File "/build/core/ocrd/ocrd/task_sequence.py", line 124, in <listcomp>
    tasks = [ProcessorTask.parse(task_str) for task_str in task_strs]
  File "/build/core/ocrd/ocrd/task_sequence.py", line 38, in parse
    raise Exception("Failed parsing task description '%s' with tokens remaining: '%s'" % (argstr, tokens))
Exception: Failed parsing task description ' cis-ocropy-segment -I OCR-D-CROP -O OCR-D-PAGE-SEG -l DEBUG -P level-of-operation page' with tokens remaining: '['-
l', 'DEBUG', '-P', 'level-of-operation', 'page']'
@kba
Copy link
Member

kba commented Sep 16, 2020

--log-level/-l is not currently supported on task level, only globally as an option to ocrd process.

I will correct this, once the other logging refactoring PR is finished.

@bertsky bertsky changed the title Debug parameter not recognized Support specific --log-level overrides in ocrd process tasks Sep 16, 2020
@bertsky
Copy link
Collaborator

bertsky commented Sep 16, 2020

Note: I have renamed the issue so it does not get confused with the (planned) --debug parameter.

@bertsky
Copy link
Collaborator

bertsky commented Sep 16, 2020

BTW I don't think any of this will help you unless #592 gets fixed.

@kba kba self-assigned this Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants