Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-09-03.17:01:49.814>labels= ['type-feature', 'library', '3.11']
title='Easier loggers traversal tree with a logger.getChildren method'updated_at=<Date2021-09-03.17:01:49.814>user='https://github.com/sblondon'
Currently, logging.root.manager.loggerDict is usable to do a homemade traversal of the loggers tree. However, it's not a public interface. Adding a 'logger.getChildren()' method would help to implement the traversal. The method would return a set of loggers.
With such method, traverse the tree will be obvious to write with a recursive function.
Use cases:
to check all the loggers are setted up correctly. I wrote a small function to get all loggers, and log on every level to check the real behaviour.
to draw the loggers tree like logging_tree library (https://pypi.org/project/logging_tree/). I didn't ask to logging_tree's maintainer but I don't think he would use such function because the library works for huge range of python releases.
I plan to write a PR if someone thinks it's a good idea.
sblondon mannequin commentedSep 3, 2021
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: