Title: Don't suppress messages when logging is not configured by EliahKagan · Pull Request #1813 · gitpython-developers/GitPython · GitHub
Open Graph Title: Don't suppress messages when logging is not configured by EliahKagan · Pull Request #1813 · gitpython-developers/GitPython
X Title: Don't suppress messages when logging is not configured by EliahKagan · Pull Request #1813 · gitpython-developers/GitPython
Description: Fixes #1806 This stops adding NullHandler instances to GitPython's loggers. As noted in #1806, when they were added in #300 this prevented errors when GitPython logged messages and logging was not enabled, but since Python 3.2 there is a logger of last resort providing a nicer default behavior of showing the messages. (They are still shown with better formatting if logging is configured, even if just done with logging.basicConfig(), so applications should still typically configure logging.) This also makes a few more minor related changes, detailed in the commit messages. This includes changing variable names from log to _logger, as mentioned in #1806 (comment), as well as consistently passing __name__ to logging.getLogger instead of hard-coding names in a few places, as mentioned in #1808 (comment). The major effect of the changes here is that messages of level WARNING or higher are not suppressed by default anymore, even when logging is not configured. So I could have included a change here to take care of #1808 as well, such as dc62096. But I plan to introduce that in a future pull request instead, because it would be best to add tests for it, which I think should build on the tests proposed in #1812. If both #1812 and this PR are merged, I can add tests followed by the changes from dc62096 that would make them pass. (If they are not merged, or they are merged with major changes, then that will also clarify how to move forward with making a warning from the initial refresh use the logging framework.) This shows as resolving several CodeQL alerts and also adding new alerts that correspond exactly to them. This happens as a result of renaming log to _logger; CodeQL considers the alert resolved because there are no more calls to log, and issues new equivalent alerts for the same situations with _logger. The new alerts produce a failing Code scanning results check for the PR.
Open Graph Description: Fixes #1806 This stops adding NullHandler instances to GitPython's loggers. As noted in #1806, when they were added in #300 this prevented errors when GitPython logged messages and logging was ...
X Description: Fixes #1806 This stops adding NullHandler instances to GitPython's loggers. As noted in #1806, when they were added in #300 this prevented errors when GitPython logged messages and logging ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1813
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:72756c0c-7f8f-b2b9-af07-5ec87c31eee7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E8B8:2C9EE:A77360:E82A4B:6968855C |
| html-safe-nonce | 91301edafb0682b4f05322df9760783b96267a0ae6cc408f270212335fce8e7f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEI4OjJDOUVFOkE3NzM2MDpFODJBNEI6Njk2ODg1NUMiLCJ2aXNpdG9yX2lkIjoiMTAwMTY5NzYwMTk2MzcyMjA3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aa2652fac076591268d727ba3ba75f7d79979937256cb2a6b2d36fbcda6af665 |
| hovercard-subject-tag | pull_request:1696873448 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1813/files |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1806 This stops adding NullHandler instances to GitPython's loggers. As noted in #1806, when they were added in #300 this prevented errors when GitPython logged messages and logging was ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef287f17234b4529a4b112a3d47fe8551e32ddd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width