Skip to content

4.0.0 - Modified to be a CPython logging subset

Compare
Choose a tag to compare
@tekktrik tekktrik released this 03 Jun 15:20
· 130 commits to main since this release
255dfff

This library now functions as a subset of the CPython logging module.

This is a breaking changes, and includes the following changes:

  • Make functions not available in CPython private
  • Now only Logger is the only logger, other loggers have been converted into Handler or subclasses of it.
  • The previous PrintLogger has been changed to StreamHandler, with the default stream argument to sys.stderr, and should be treated as a handler as opposed to a logger.
  • Logger can now take a name that gets added to the corresponding global variable
  • Methods have had argument names changed to match CPython names
  • Logger now has no handler as a default
  • hasHandlers() has been added to help offset the previous change
  • FileHandler was moved, and is imported from the main file (e.g. from adafruit_logging import FileHandler)
  • FileHandler is now a subclass of StreamHandler

Additionally:

  • The module has been flattened to a single file
  • setup.py has been modified accordingly
  • Examples updated to account for changes, particularly the change of some previous loggers to handlers

To use in CircuitPython, simply install the Adafruit CircuitPython Bundle.

To use in CPython, pip3 install adafruit-circuitpython-logging.

Read the docs for info on how to use it.