Node LogPoints should support outputting well formatted objects #47275
Labels
debug
Debug viewlet, configurations, breakpoints, adapter issues
feature-request
Request for new features or functionality
release-notes
Release notes issues
verification-needed
Verification of issue is requested
verified
Verification succeeded
Milestone
Per conversation microsoft/vscode-node-debug#174
Node LogPoints should support outputting well formatted objects
Example:
So what could be a solution here?
Breakdown expressions and forward to console.log as arguments?
Product: {product}
->console.log('Product:', product
)?Product.constructor.getProduct for {product.id}, result: {product}
->console.log('Product.constructor.getProduct for :', product.id, "result:", product
)?Use formatting options for expressions:
Chrome/Node supports print-if style formatting. Se https://developers.google.com/web/tools/chrome-devtools/console/console-reference#format-specifiers and https://nodejs.org/api/util.html#util_util_format_format_args
Product: {product}
->console.log('Product %o', product
)?Product.constructor.getProduct for {product.id}, result: {product}
->console.log('Product.constructor.getProduct for %o, result: %o, product.id, product
)?https://developers.google.com/web/tools/chrome-devtools/console/console-write
The text was updated successfully, but these errors were encountered: