Skip to content

Switch to logging in __init__.py, set load message to debug #171

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

incognitojam
Copy link

  • Replace print statements with logger.error() and logger.debug() calls.
  • Follow best practices by using a module-specific logger via getLogger(__name__).
  • Use parameterized log messages to avoid unnecessary string formatting.
  • Change the "RAYLIB STATIC x.x.x LOADED" message from direct stderr output to logger debug level.

Motivation:
In commaai/openpilot#35076, we experienced noisy test outputs because the RAYLIB STATIC message is printed unnecessarily, cluttering stderr. This change allows library consumers to control the visibility of this message.

- Replace print statements with logger.error() and logger.debug() calls.
- Follow best practices by using a module-specific logger via
  getLogger(__name__).
- Use parameterized log messages to avoid unnecessary string formatting.
- Change the "RAYLIB STATIC x.x.x LOADED" message from direct stderr
  output to logger debug level.

Motivation:
In [commaai/openpilot#35076][openpilot-issue], we experienced noisy test
outputs because the RAYLIB STATIC message is printed unnecessarily,
cluttering stderr. This change allows library consumers to control the
visibility of this message.

[openpilot-issue]: commaai/openpilot#35076
@electronstudio
Copy link
Owner

I think we should have similar behaviour to Raylib itself:

  1. By default the initialisation message should be printed
  2. But there should be a way for advanced users to turn it off

I'm not sure the best way to achieve this. The default log level is WARNING so logger.debug() won't print anything. We could do logger.warning() I guess, even though it isn't really a warning, it's an info?

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