Skip to content

fix attribute list and NOTSET description in docs #36

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

Merged
merged 2 commits into from
Jul 12, 2022

Conversation

FoamyGuy
Copy link
Contributor

This tweak to the attribute list syntax allows them to get drawn with more visual seperation on the final docs page.

The current docs page looks like this:
image

The version with these changes looks like this:
image

@FoamyGuy
Copy link
Contributor Author

The latest commit updates the description for NOTSET to more closely match the CPython documentaiton here: https://docs.python.org/3/library/logging.html#logging.Handler.setLevel

NOTSET: int
        The NOTSET logging level, which is the default logging level that can be
        used to indicate that a `Logger` should process any logging messages,
        regardless of how severe those messages are.

Our previous description of this level value was essentially opposite of what CPython docs specify. (Suppress all log messages, rather than process all log messages).

As far as I can tell the currently library behavior does match the CPython description of processing all messages regardless of level.

import adafruit_logging as logging

logger = logging.getLogger("test")
print_logger = logging.StreamHandler()
logger.addHandler(print_logger)
logger.setLevel(logging.NOTSET)

logger.info("Info message\n")
logger.error("Error message\n")

output:

5645.131: INFO - Info message
5645.131: ERROR - Error message

This change is meant to resolve #35

@FoamyGuy FoamyGuy changed the title fix attribute list in docs fix attribute list and NOTSET description in docs Jul 11, 2022
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

Makes sense, great catch!

@tekktrik tekktrik merged commit 57eceb1 into adafruit:main Jul 12, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 13, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.12.7 from 2.12.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#74 from tekktrik/dev/add-optional-requirements

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.5.1 from 2.5.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#51 from nicolasff/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 4.1.3 from 4.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#36 from FoamyGuy/docs_attributes_fix
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