Skip to content

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

Closed
@dhalbert

Description

@dhalbert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions