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

getLogger Irritation with regular CLI #55

Closed
M3ssman opened this issue Apr 25, 2021 · 5 comments
Closed

getLogger Irritation with regular CLI #55

M3ssman opened this issue Apr 25, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@M3ssman
Copy link

M3ssman commented Apr 25, 2021

Issue description

Using recent version (1778b3) of dinglehopper complains because of OCR-D-Logger

dinglehopper 1300565-gt.xml 1300565.xml

=> 

21:17:33.416 CRITICAL root - getLogger was called before initLogging. Source of the call:
21:17:33.416 CRITICAL root -   File "/home/hartwig/Projekte/work/mlu/ulb/ulb-sachsen-anhalt-dinglehopper/qurator/dinglehopper/extracted_text.py", line 243, in get_first_textequiv
21:17:33.416 CRITICAL root -     log = getLogger("processor.OcrdDinglehopperEvaluate")

Even though all report-files are being generated, the output is somehow irritating.

Steps to reproduce the issue

  1. call dinglehopper 1300565-gt.xml 1300565.xml (attached)

What's the expected result?

  • No logging error or no logging at all if no OCR-D is around

Additional details

The Problem could be worked around if you use OCR-D's initLogging also within the context of the non-OCR-D-CLI, adding in cli.py something like this:

initLogging()
Config.progress = progress
process(gt, ocr, report_prefix, metrics=metrics, textequiv_level=textequiv_level)

Does dinglehopper want to stick with the OCR-D-Logger also in potential non-OCR-D-contexts? Further, it looks like dinglehopper is currently missing any dedicated logging-configuration, which couples it rather strong not only to the OCR-D-Logging-Logic, but also to it's configuration.

1300565-test.zip

@kba
Copy link
Contributor

kba commented Apr 26, 2021

The Problem could be worked around if you use OCR-D's initLogging also within the context of the non-OCR-D-CLI, adding in cli.py something like this:

I'm open to reintroducing on-the-fly initLogging() and dropping the error messages, as they should really be debug messages, maybe discuss in OCR-D/core#621

which couples it rather strong not only to the OCR-D-Logging-Logic, but also to it's configuration.

But is that such a bad thing? Reusing the OCR-D logging framework gives configuration files and globally overrideable log levels. My point is that it would benefit all things OCR-D if we improved the versatility/usability of the logging framework.

@mikegerber
Copy link
Member

Yes, this errror message bothered me too, last time I used the non-OCR-D CLI. I'll look into it

@mikegerber mikegerber self-assigned this Apr 26, 2021
@mikegerber mikegerber added the bug Something isn't working label Apr 26, 2021
@M3ssman
Copy link
Author

M3ssman commented Apr 26, 2021

@kba Totally agree in the realms of OCR-D. But this time its all about dinglehopper's non-OCR-D-CLI.
To be honest, I wasn't even able to figure out where the log messages are going after all.

@mikegerber
Copy link
Member

We now just call ocrd_utils' initLogging() in both the non-OCR-D CLIs dinglehopper and dinglehopper-extract to get this resolved!

@mikegerber
Copy link
Member

To be honest, I wasn't even able to figure out where the log messages are going after all.

To stdout, it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants