Skip to content

Conversation

jamesbraza
Copy link
Collaborator

My logs were getting blown up by OpenAI, so I lowered this

Also see Future-House/ldp#315

@jamesbraza jamesbraza self-assigned this Jul 14, 2025
@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 18:50
@jamesbraza jamesbraza added the enhancement New feature or request label Jul 14, 2025
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces the verbosity of OpenAI base client logs by raising its log level to WARNING.

  • Added a logging configuration block in setup_default_logs to silence lower-level OpenAI logs.
  • Updated default logging setup to include the new config.
Comments suppressed due to low confidence (3)

paperqa/utils.py:460

  • Add a unit test for setup_default_logs that asserts the openai._base_client logger level is set to WARNING.
    logging.config.dictConfig(

paperqa/utils.py:457

  • Update the setup_default_logs docstring to mention that it configures openai._base_client to WARNING level.
def setup_default_logs() -> None:

paperqa/utils.py:460

  • [nitpick] Consider adding import logging.config at the top of the file to ensure dictConfig is available and avoid potential attribute errors.
    logging.config.dictConfig(

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 14, 2025
@jamesbraza jamesbraza merged commit 4e56369 into main Jul 14, 2025
5 checks passed
@jamesbraza jamesbraza deleted the suppressing-loggers branch July 14, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants