executablebooks / markdown-it-py

Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed. Now in Python!
https://markdown-it-py.readthedocs.io
MIT License
706 stars 68 forks source link

Please reduce the number of loggers and improve the naming schema #330

Closed Zaczero closed 7 months ago

Zaczero commented 7 months ago

Context

It is currently not possible to easily manage the loggers because of the sheer number of them.

https://github.com/search?q=repo%3Aexecutablebooks%2Fmarkdown-it-py+getLogger&type=code

Since this is a library intended to be used in other applications, I recommend reducing the number of loggers to 1 and giving it an easily rememberable name.

Proposal

You can find some inspiration in the HTTPX library, which has just 2 loggers. Each one with a clear separation of responsibilities.

https://www.python-httpx.org/logging/

Tasks and updates

No response

welcome[bot] commented 7 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 7 months ago

Heya, I feel you are misunderstanding how Python logging works; they are all children of the same root markdown_it logger, if you apply handlers/formatters to that then it will apply to all of them (unless you use propagate=False)

See https://docs.python.org/3/howto/logging.html

Zaczero commented 7 months ago

image

Yes, my bad, you are right!