Skip to content

Make true CPython subset? #27

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
tekktrik opened this issue May 9, 2022 · 6 comments · Fixed by #28
Closed

Make true CPython subset? #27

tekktrik opened this issue May 9, 2022 · 6 comments · Fixed by #28

Comments

@tekktrik
Copy link
Member

tekktrik commented May 9, 2022

Now that the library is listed on PyPI, is it worth make this a true subset of the CPython logging module? It would mean moving things around between files, I think a breaking change. Happy to close if not.

@askpatrickw
Copy link
Contributor

I believe that is the general goal for libraries. If the group agrees, I'm happy to provide manual testing when you get to it.

@ladyada
Copy link
Member

ladyada commented May 21, 2022

@tekktrik just getting to this email now lol! what would have to break? we do use this library a few places, so just want to know what has to get updated post-fix

@tekktrik
Copy link
Member Author

tekktrik commented May 21, 2022

Here's a list with some comments:

  • level_for() should probably be private - I think it's only purpose is internal use anyway
  • I think PrintHandler would become StreamHandler with the only stream allowable being the standard output
  • FileHandler would move out of the current extensions.py and into __init__.py. At that point this could turn back into a single adafruit_logging.py file
  • Minor, but I do know FileHandler keeps it's stream open rather than using a context manager internally, but figured I'd mention it

I thiiiiiink that's everything.

@tekktrik
Copy link
Member Author

Oh, in CPython logging, FileHandler inherits from StreamHandler.

@ladyada
Copy link
Member

ladyada commented May 21, 2022

@tekktrik sounds good to me, if you're willing to make the updates!

@tekktrik
Copy link
Member Author

Definitely!

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.

3 participants