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

Disable logging for PyPDF in layout_analysis_parsers.py #5

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

junkeon
Copy link
Collaborator

@junkeon junkeon commented Jun 10, 2024

Description

This pull request addresses an issue with excessive logging by the PyPDF library, which results in cluttered log output and can obscure important information. The specific problem occurs when image files are input, generating multiple error logs such as:

invalid pdf header: b'\x89PNG\r'
EOF marker not found
EOF marker not found
EOF marker not found

In order to address this issue, we have disabled detailed logging for PyPDF within layout_analysis_parsers.py.

Changes Made

  • Added the following code to layout_analysis_parsers.py to suppress unnecessary error logs from PyPDF, ensuring a smooth and efficient execution of the script.

    logger = logging.getLogger("pypdf")
    logger.setLevel(logging.ERROR)

Reason for Changes

The main impetus for this modification is to avoid excessive log clutter caused by non-essential error messages. These messages did not provide valuable insights and impeded the identification of pertinent log entries.

Please review the modifications and inform us if you have any queries or require additional alterations. Thank you.

@junkeon junkeon requested a review from chosh0615 June 10, 2024 01:50
@junkeon junkeon merged commit 7233285 into main Jun 10, 2024
12 checks passed
@junkeon junkeon deleted the junkeon/fix_logger branch June 10, 2024 05:55
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