Skip to content

improve logging and page validator#1359

Merged
kba merged 5 commits into
OCR-D:masterfrom
bertsky:mp-logging-prefixed
May 5, 2026
Merged

improve logging and page validator#1359
kba merged 5 commits into
OCR-D:masterfrom
bertsky:mp-logging-prefixed

Conversation

@bertsky
Copy link
Copy Markdown
Collaborator

@bertsky bertsky commented May 5, 2026

sry, another non-topical PR ...

  • 19b3032: a bug fix
  • 759ba52: help make sense of log messages when running page-parallel
  • 8cc98b0: avoid getting run over with Pillow and Shapely messages when running with -l DEBUG
  • 3372bd2: fix bug in PageValidator (cope with ReadingOrder comprised of UnorderedGroup as well)
  • fae27c5: new feature for ocrd workspace validate to easily filter in/out fileGrps (just delegate existing functionality to CLI)

@bertsky bertsky requested a review from kba May 5, 2026 14:19
Comment thread src/ocrd/cli/workspace.py
@click.option('--page-coordinate-consistency', help="How fierce to check PAGE multi-level coordinate consistency",
type=click.Choice(['poly', 'baseline', 'both', 'off']), default='poly')
@click.option('-q', '--include-file-grps', 'include_fileGrp', help="fileGrps to include", default=[], multiple=True)
@click.option('-Q', '--exclude-file-grps', 'exclude_fileGrp', help="fileGrps to exclude", default=[], multiple=True)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for consistency and useful for doing targeted validation of experimental workspaces with lots of groups.

logging.root.handlers = [logging.handlers.QueueHandler(log_queue)]
logging.root.handlers[0].setFormatter(
# insert pageId before actual message
logging.Formatter(fmt='[%(pageId)s] %(message)s'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very useful for debugging. An eventual (yet another) refactoring of the logging to provide such metadata per-message throughout would be tremendous. "Wenn mal Zeit ist..."

@kba kba merged commit a3f1f07 into OCR-D:master May 5, 2026
13 checks passed
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 this pull request may close these issues.

2 participants