Title: Align paths in traces · Issue #22575 · nodejs/node · GitHub
Open Graph Title: Align paths in traces · Issue #22575 · nodejs/node
X Title: Align paths in traces · Issue #22575 · nodejs/node
Description: When an exception is thrown or when using console.trace(), files paths are not aligned making it difficult to follow them at naked eye and specially to identify when it's one of your files, one internal module of if it's a file located i...
Open Graph Description: When an exception is thrown or when using console.trace(), files paths are not aligned making it difficult to follow them at naked eye and specially to identify when it's one of your files, one int...
X Description: When an exception is thrown or when using console.trace(), files paths are not aligned making it difficult to follow them at naked eye and specially to identify when it's one of your files, one...
Opengraph URL: https://github.com/nodejs/node/issues/22575
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Align paths in traces","articleBody":"When an exception is thrown or when using `console.trace()`, files paths are not aligned making it difficult to follow them at naked eye and specially to identify when it's one of your files, one internal module of if it's a file located inside `node_modules` folder:\r\n\r\n```js\r\nUnhandledPromiseRejectionWarning: SyntaxError: Identifier 'body' has already been declared\r\n at Test.Runnable (/opt/app/node_modules/mocha/lib/runnable.js:36:25)\r\n at new Test (/opt/app/node_modules/mocha/lib/test.js:24:12)\r\n at context.it.context.specify (/opt/app/node_modules/mocha/lib/interfaces/bdd.js:85:18)\r\n at Function.context.it.only (/opt/app/node_modules/mocha/lib/interfaces/bdd.js:96:46)\r\n at Object.\u003canonymous\u003e (/opt/app/src/modules/templates/template.spec.js:21:4)\r\n at Module._compile (internal/modules/cjs/loader.js:689:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\r\n at Module.load (internal/modules/cjs/loader.js:599:32)\r\n at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\r\n at Function.Module._load (internal/modules/cjs/loader.js:530:3)\r\n at Module.require (internal/modules/cjs/loader.js:637:17)\r\n at require (internal/modules/cjs/helpers.js:20:18)\r\n at /opt/app/node_modules/mocha/lib/mocha.js:250:27\r\n at Array.forEach (\u003canonymous\u003e)\r\n at Mocha.loadFiles (/opt/app/node_modules/mocha/lib/mocha.js:247:14)\r\n at Mocha.run (/opt/app/node_modules/mocha/lib/mocha.js:576:10)\r\n```\r\n\r\nNot sure if this is done at `v8` level, but my proposal is to add spaces between the function name and the file paths so this last ones gets aligned between themselves to the longest one. In the previous trace, it would get like:\r\n\r\n```js\r\nUnhandledPromiseRejectionWarning: SyntaxError: Identifier 'body' has already been declared\r\n at Test.Runnable (/opt/app/node_modules/mocha/lib/runnable.js:36:25)\r\n at new Test (/opt/app/node_modules/mocha/lib/test.js:24:12)\r\n at context.it.context.specify (/opt/app/node_modules/mocha/lib/interfaces/bdd.js:85:18)\r\n at Function.context.it.only (/opt/app/node_modules/mocha/lib/interfaces/bdd.js:96:46)\r\n at Object.\u003canonymous\u003e (/opt/app/src/modules/templates/template.spec.js:21:4)\r\n at Module._compile (internal/modules/cjs/loader.js:689:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\r\n at Module.load (internal/modules/cjs/loader.js:599:32)\r\n at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\r\n at Function.Module._load (internal/modules/cjs/loader.js:530:3)\r\n at Module.require (internal/modules/cjs/loader.js:637:17)\r\n at require (internal/modules/cjs/helpers.js:20:18)\r\n at /opt/app/node_modules/mocha/lib/mocha.js:250:27\r\n at Array.forEach (\u003canonymous\u003e)\r\n at Mocha.loadFiles (/opt/app/node_modules/mocha/lib/mocha.js:247:14)\r\n at Mocha.run (/opt/app/node_modules/mocha/lib/mocha.js:576:10)\r\n```\r\n\r\nThere would be problems if some code is parsing the trace output taking in consideration to be just only a space between the function name and the file path instead of several spaces, so this change would need to be in a major version, but anyway exception traces are not standard and such libs are very few and mostly for debuging purposses so their impact will be low, and is a small change that they would be easily added.","author":{"url":"https://github.com/piranna","@type":"Person","name":"piranna"},"datePublished":"2018-08-29T00:04:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/22575/node/issues/22575"}
| 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:363021db-b375-b625-bcd7-f65ad83aaab0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC58:1F26:203752:30E077:6A4DDF02 |
| html-safe-nonce | d55446fb45265f7baa0c2d76357486e6cdae9dbb51a9880e207076bfc39cb305 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzU4OjFGMjY6MjAzNzUyOjMwRTA3Nzo2QTREREYwMiIsInZpc2l0b3JfaWQiOiI0MjUxMDIwMjU2MTA3OTQ1NzMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bec583b6605d96565c72a26399276f3e93c18f47bd4556554e92c04e56c39ce9 |
| hovercard-subject-tag | issue:354947135 |
| 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/nodejs/node/22575/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49dba94693158ed2cecbb07c56dc72eae4f49c8a7b3a15734006bd82ef96745f/nodejs/node/issues/22575 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49dba94693158ed2cecbb07c56dc72eae4f49c8a7b3a15734006bd82ef96745f/nodejs/node/issues/22575 |
| og:image:alt | When an exception is thrown or when using console.trace(), files paths are not aligned making it difficult to follow them at naked eye and specially to identify when it's one of your files, one int... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | piranna |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| 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 | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width