-
Notifications
You must be signed in to change notification settings - Fork 31
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
document initLogging requirement #621
Comments
Three thumbs up! |
Sorry to hear this hit you in the back. I don't understand what you say there exactly, though. So you have a program that imports (some of) core's packages, but does not use the Processor CLI decorator (which brings Also, what's a |
Within our main migration workflow scripts I do use some functionalities of OCR-D core for workspace preparation and so on (e.g. : https://github.com/OCR-D/ocrd-website/wiki/How-to-create-searchable-Fulltext-Data-for-DFG-Viewer).
This one The reason to introduce this was to have a short-cut to silence logging from all 3rd-party-libs ocrd uses ... ? |
The reason for doing this was to prevent libraries like tensorflow non-processing-related logging in processors from interfering with
That was intentional and this behavior, that Where should I document this? |
If the main reason to turn off logging totally is the behavior of tensorflow, question: It is possible to integrate tensowflow into the default logging conf file? If so, I'd prefer this, since this too documents that there's a problem with tensorflow logging if left alone. |
We should probably mirror the builtin defaults to the logging.conf, i.e.
Maybe we should just move to using the builtin |
No, not just TF. Any library that is imported by processors and already logs things at module init time is problematic for CLIs that want to control exactly what appears on stdout. We've also seen pyplot do this and some others (don't recall).
I don't really see a connection to the issue at hand, and I think it's useful to not rely on filesystem access for the defaults. Maybe we should first try to pinpoint exactly what @M3ssman needs to import from core without breaking other logging components. For our processors, we have Maybe the problem is that we require |
@kba
and so on? |
Posting here, since this is related, I really need to clean up the logging setup and re-align the standard-logging of #974 with the rest of the code base. |
Using any of core's API (even just
ocrd_utils
) now requires callinginitLogging
at some point prior to usage, or the respective subpackage'sgetLogger
will complain withCRITICAL
.So not only is it not correct anymore to do
ocrd_utils.getLogger
at module level, any program or library using core must also doocrd_utils.initLogging
during its initialization (but not necessarily on the module level) now.This must be reflected somewhere in the documentation prominently.
The text was updated successfully, but these errors were encountered: