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

processing with --log-level override does not apply anymore #1232

Closed
bertsky opened this issue Jun 5, 2024 · 4 comments · Fixed by #1288
Closed

processing with --log-level override does not apply anymore #1232

bertsky opened this issue Jun 5, 2024 · 4 comments · Fixed by #1288
Assignees

Comments

@bertsky
Copy link
Collaborator

bertsky commented Jun 5, 2024

It seems that with 2696705 we lost the ability to control all loggers at once from the CLI.

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 5, 2024

@kba you commented

Changes as of 2023-08-20:

  • Try to be less intrusive with OCR-D specific logging conventions to
    make it easier and less surprising to define logging behavior when
    using OCR-D/core as a library
  • Change setOverrideLogLevel to only override the log level of the ocrd
    logger and its descendants
  • initLogging will set exactly one handler, for the root logger or for the
    ocrd logger.
  • Child loggers should propagate to the ancestor logging (default
    behavior of the logging library - no more PropagationShyLogger)
  • disableLogging only removes any handlers from the ocrd logger

But how did you intend to effect that all loggers (e.g. processor.Tesserocr) are inheriting from ocrd?

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 5, 2024

More explanation on #1080:

Until now, we implemented --log-level/setOverrideLoglevel by changing the default logger to one that does not propagate and overriding the levels of every logger. Now, we keep the default behavior (all loggers propagate) and only change the level of the ocrd logger. We leave the root logger alone completely.

Again, I don't quite get it. How can this work with all the loggers we use in the wild, the least of which actually derive from ocrd? (For example, we have ocrd_network.* and processor.* ...)

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 5, 2024

So perhaps as a workaround we could move the other loggers under ocrd (i.e. ocrd.ocrd_network.*, ocrd.processor.* etc.). But what about other loggers we wanted to affect in ocrd_logging.conf (e.g. shapely, PIL or tensorflow)?

Also, setOverrideLogLevel API broke.

@bertsky
Copy link
Collaborator Author

bertsky commented Jun 5, 2024

Also, it seems that the log config file (e.g. ~/ocrd_logging.conf) still takes precedence: If I run ocrd-tesserocr-recognize with --log-level ERROR I can still see ocrd.workspace.save_image_file messages with INFO level...

@kba kba assigned kba and MehmedGIT and unassigned kba Jul 3, 2024
@bertsky bertsky linked a pull request Nov 12, 2024 that will close this issue
@kba kba closed this as completed in #1288 Nov 18, 2024
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

Successfully merging a pull request may close this issue.

3 participants