Skip to content

Refactor logger to extract counter #279

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

nateinaction
Copy link
Member

Summary

This PR adds a middleware pattern to the logger, allowing its functionality to be extended.

Our logger has always felt like a terrific generic logging platform that doesn't exist yet in the CircuitPython community. The only issue is when we add in features that are specific to this repo like our Counter. This PR extracts the counter into a middleware which can be optionally included wherever it is wanted. Eventually this pattern could evolve further with middlewares for colorizing, writing logs to files, etc.

How was this tested

  • Added new unit tests
  • Ran code on hardware (screenshots are helpful)
  • Other (Please describe)

@nateinaction nateinaction mentioned this pull request Jul 17, 2025
3 tasks
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.

1 participant