Skip to content

Make default logging level be consistent with CPython: set to 30 #37

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

Closed
dhalbert opened this issue Jul 21, 2022 · 0 comments · Fixed by #41
Closed

Make default logging level be consistent with CPython: set to 30 #37

dhalbert opened this issue Jul 21, 2022 · 0 comments · Fixed by #41

Comments

@dhalbert
Copy link
Contributor

The default logging level for logging.getLogger() in CPython is 30 (WARNING):

Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> l = logging.getLogger()
>>> l.getEffectiveLevel()
30
>>> l1 = logging.getLogger("foo")
>>> l1.getEffectiveLevel()
30

However, in this library, it is 0. It should be be consistent with CPython.

>>> import adafruit_logging
>>> l = adafruit_logging.getLogger()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes 1 positional arguments but 0 were given
>>> l = adafruit_logging.getLogger("foo")
>>> l.getEffectiveLevel()
0

Note also that you can't give no arg to getLogger(). I'll open a separate issue for that.

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 a pull request may close this issue.

1 participant