node/lib/internal/process
James M Snell dd20e68b0f process: add optional detail to process emitWarning
Adds a new method signature variant for process.emitWarning()
that accepts an options object. The options object may include
a new `detail` option that allows additional detail text to be
associated with the warning. By default, this additional text
will be printed to stderr along with the warning, and included
on the Warning Error object using the `.detail` property.

e.g.

```js
process.emitWarning('A message', {
  code: 'WARNING123',
  detail: 'This is additional detail'
});
// Emits:
// (node {pid}) [WARNING123] Warning: A message
// This is additional detail
```

PR-URL: https://github.com/nodejs/node/pull/12725
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-05-01 11:53:47 -07:00
..
next_tick.js errors: port internal/process errors to internal/errors 2017-04-20 11:34:07 -07:00
promises.js process: cast promise rejection reason to string 2017-04-30 01:00:46 +02:00
stdio.js process: fix permanent deoptimizations 2017-04-30 03:17:43 -04:00
warning.js process: add optional detail to process emitWarning 2017-05-01 11:53:47 -07:00
write-coverage.js lib: remove an unnecessary coverage check 2017-03-26 11:32:16 +02:00