Skip to content

Fix call to logging._level #12

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 2 commits into
base: master
Choose a base branch
from

Conversation

TomHodson
Copy link

I just installed your excellent library on an ESP32, and got it working by making this change. I can't say I've read every line of your library and logging.py but it looks like maybe logging._level was removed at some point after you wrote the library?

Anyway I think using self._log.level seems to be the right fix.

@TomHodson
Copy link
Author

An additional fix, to get the logging levels to work (I wanted to disable logging by setting logLevel to WARNING) I had to as make the change in the second commit

@@ -124,8 +124,8 @@ def __init__(self, shunt_ohms, i2c, max_expected_amps=None,
log_level -- set to logging.DEBUG to see detailed calibration
calculations (optional).
"""
logging.basicConfig(level=log_level)
Copy link
Owner

@chrisb2 chrisb2 Apr 11, 2023

Choose a reason for hiding this comment

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

I think we should follow the pattern in the RPi version of this library and check if the logger is already setup, see RPi ina219.py, which was made in this PR?

@TomHodson
Copy link
Author

Any updates on this? I'm pretty sure it works and you could just merge it.

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.

None yet

2 participants