Logging does not inherit the root logger's configuration
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 1.9k
- Avg merge
- 17m
- Merged PRs (30d)
- 2
Description
The following lines do not allow the github logger to let the root logger propagate all of its configuration to it.
They also cause messages to be directly printed to stderr, when one might not necessarily want that behaviour (e.g. letting rich format log messages before printing to stderr).
https://github.com/PyGithub/PyGithub/blob/5cdf6ab395c52efb652d0bc1f28fdf2e452b1b41/github/__init__.py#L75-L78
This can be worked around by doing the following:
import logging
import github
logging.getLogger('github').handlers.clear()
logging.getLogger('github').setLevel(logging.NOTSET)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in github/init.py at lines 75-78 and inspect how the github logger is configured. Compare that behavior with the root logger and the workaround using logging.getLogger('github'); done means root configuration can propagate without messages being directly printed to stderr.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100