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

use ophyd async logger for logging.debug statements #686

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rerpha
Copy link
Contributor

@rerpha rerpha commented Nov 29, 2024

in an interactive shell we found we got a global logging handler added after a PV failed to connect.

We found these logging.debug statements which use the "simple"/global logging API which is not recommended as per: https://docs.python.org/3/library/logging.html#logging.debug

where it mentions this:

The only difference is that if the root logger has no handlers, then basicConfig() is called, prior to calling debug on the root logger.
For very short scripts or quick demonstrations of logging facilities, debug and the other module-level functions may be convenient. However, most programs will want to carefully and explicitly control the logging configuration, and should therefore prefer creating a module-level logger and calling Logger.debug() (or other level-specific methods) on it, as described at the beginnning of this documentation.

This PR gets the ophyd-async logger and uses it instead of the global functions.

@Tom-Willemsen
Copy link
Member

Tom-Willemsen commented Nov 29, 2024

… to linting rules, add noqa to make_switcher.py
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