Title: Deal with exc_info not being a tuple while not being None either in JsonLogFormatter · Issue #46 · mozilla-services/python-dockerflow · GitHub
Open Graph Title: Deal with exc_info not being a tuple while not being None either in JsonLogFormatter · Issue #46 · mozilla-services/python-dockerflow
X Title: Deal with exc_info not being a tuple while not being None either in JsonLogFormatter · Issue #46 · mozilla-services/python-dockerflow
Description: JsonLogFormatter does: python-dockerflow/src/dockerflow/logging.py Lines 125 to 128 in d7fadb7 # If there is an error, format it for nice output. if record.exc_info is not None: fields["error"] = repr(record.exc_info[1]) fields["tracebac...
Open Graph Description: JsonLogFormatter does: python-dockerflow/src/dockerflow/logging.py Lines 125 to 128 in d7fadb7 # If there is an error, format it for nice output. if record.exc_info is not None: fields["error"] = r...
X Description: JsonLogFormatter does: python-dockerflow/src/dockerflow/logging.py Lines 125 to 128 in d7fadb7 # If there is an error, format it for nice output. if record.exc_info is not None: fields["error&...
Opengraph URL: https://github.com/mozilla-services/python-dockerflow/issues/46
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deal with exc_info not being a tuple while not being None either in JsonLogFormatter","articleBody":"`JsonLogFormatter` does:\r\nhttps://github.com/mozilla-services/python-dockerflow/blob/d7fadb7380798bb8d1df5e50b84bf9defdedf5aa/src/dockerflow/logging.py#L125-L128\r\n\r\nHowever, [python logging docs say](https://docs.python.org/3/library/logging.html#logging.Logger.debug):\r\n\u003e If `exc_info` does not evaluate as false, it causes exception information to be added to the logging message. If an exception tuple (in the format returned by `sys.exc_info()`) or an exception instance is provided, it is used; otherwise, `sys.exc_info()` is called to get the exception information.\r\n\r\nThe difference is notable, because there is code out there that calls `log.something(..., exc_info=False)`. In AMO, which has a logger inheriting from `JsonLogFormatter`, that causes the following traceback:\r\n```\r\n File \"/usr/local/lib/python3.6/logging/__init__.py\", line 994, in emit\r\n msg = self.format(record)\r\n File \"/usr/local/lib/python3.6/logging/__init__.py\", line 840, in format\r\n return fmt.format(record)\r\n File \"/deps/lib/python3.6/site-packages/dockerflow/logging.py\", line 138, in format\r\n out = self.convert_record(record)\r\n File \"/code/src/olympia/core/logger.py\", line 58, in convert_record\r\n out = super().convert_record(record)\r\n File \"/deps/lib/python3.6/site-packages/dockerflow/logging.py\", line 127, in convert_record\r\n fields[\"error\"] = repr(record.exc_info[1])\r\nTypeError: 'bool' object is not subscriptable\r\n```","author":{"url":"https://github.com/diox","@type":"Person","name":"diox"},"datePublished":"2020-06-04T21:32:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/46/python-dockerflow/issues/46"}
| 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:489dbb73-15c4-d8cf-513b-2ec6aed0c6aa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDC0:3C777:FABCF6:16775F5:6A589B83 |
| html-safe-nonce | 93c8f2b3f1d84ec220e885a872cc29aacb29b9b76c30130f8051db884369433a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREMwOjNDNzc3OkZBQkNGNjoxNjc3NUY1OjZBNTg5QjgzIiwidmlzaXRvcl9pZCI6IjUwMjE3MzkxMzY1MDk4NDQzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 892d2d035d65e15f25f3944e63453ba1ff95e855e61ddb7db11c1ed0afb01b0e |
| hovercard-subject-tag | issue:631161773 |
| 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/mozilla-services/python-dockerflow/46/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39067ba4adcf12fc087b391a4837fcbdaedf6ba0aa27cb789344dff88cc567ab/mozilla-services/python-dockerflow/issues/46 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39067ba4adcf12fc087b391a4837fcbdaedf6ba0aa27cb789344dff88cc567ab/mozilla-services/python-dockerflow/issues/46 |
| og:image:alt | JsonLogFormatter does: python-dockerflow/src/dockerflow/logging.py Lines 125 to 128 in d7fadb7 # If there is an error, format it for nice output. if record.exc_info is not None: fields["error"] = r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | diox |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/mozilla-services/python-dockerflow git https://github.com/mozilla-services/python-dockerflow.git |
| octolytics-dimension-user_id | 1066228 |
| octolytics-dimension-user_login | mozilla-services |
| octolytics-dimension-repository_id | 73705921 |
| octolytics-dimension-repository_nwo | mozilla-services/python-dockerflow |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 73705921 |
| octolytics-dimension-repository_network_root_nwo | mozilla-services/python-dockerflow |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width