Title: Logging setup violates best practices · Issue #27 · ipdata/python · GitHub
Open Graph Title: Logging setup violates best practices · Issue #27 · ipdata/python
X Title: Logging setup violates best practices · Issue #27 · ipdata/python
Description: I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library calls logging.basicConfig to set a Rich...
Open Graph Description: I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library...
X Description: I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library...
Opengraph URL: https://github.com/ipdata/python/issues/27
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Logging setup violates best practices","articleBody":"I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library calls logging.basicConfig to set a RichHandler instance for the root logger if one is not otherwise defined. It then writes its logs to a logger named \"rich\".\r\n\r\nThis violates several of python's best practices regarding configuring logging within a library: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library\r\n\r\nIn particular, the issue that is causing problems for my application is that the app does not define any handlers on the root logger, but when we started using ipdata, all of a sudden logs from all of our 3rd party libraries were showing up in our log and in strange formats, resulting in further downstream frustrations.\r\n\r\nTo be compliant with python best practices, I believe that the logging.basicConfig call should be removed from the ipdata library and the logger name used by the library should be updated to `__name__ `.","author":{"url":"https://github.com/mdecuir","@type":"Person","name":"mdecuir"},"datePublished":"2023-11-07T14:03:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/27/python/issues/27"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:11701c97-a3cb-3b05-6173-533d1d96a5e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84CA:181429:B1CEC0:FE4197:6978C77D |
| html-safe-nonce | acb812c8fdf23f042b8bf36ad7fe0be093edbd8677fab0ff7cf6a8659318de70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NENBOjE4MTQyOTpCMUNFQzA6RkU0MTk3OjY5NzhDNzdEIiwidmlzaXRvcl9pZCI6IjQ3Mzc4OTg1NjQ4MTIzMjY3ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8a6060299e5f00f82f89d46e203042f4062d8796d09c64e30616fa6774a3e81c |
| hovercard-subject-tag | issue:1981440828 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/ipdata/python/27/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4ee4689136d05b602c469d8e647f1caad810b92445a9c28c09b4d1413bc7b0c3/ipdata/python/issues/27 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4ee4689136d05b602c469d8e647f1caad810b92445a9c28c09b4d1413bc7b0c3/ipdata/python/issues/27 |
| og:image:alt | I just ran into an issue when adding ipdata as a library used by my project that the log outputs I received suddenly changed formatting. Upon digging into the issue, I found that the ipdata library... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mdecuir |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ipdata/python git https://github.com/ipdata/python.git |
| octolytics-dimension-user_id | 33085067 |
| octolytics-dimension-user_login | ipdata |
| octolytics-dimension-repository_id | 108238848 |
| octolytics-dimension-repository_nwo | ipdata/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 108238848 |
| octolytics-dimension-repository_network_root_nwo | ipdata/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eaed570eead52a9920afef75dc3eb6d826fdc5ef |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width