{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/10116","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/10116/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/10116/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/10116/events","html_url":"https://github.com/nodejs/node/pull/10116","id":193375875,"number":10116,"title":"process: Add code to warnings, assign codes to deprecations","user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"labels":[{"id":155267502,"url":"https://api.github.com/repos/nodejs/node/labels/c++","name":"c++","color":"e11d21","default":false},{"id":281232761,"url":"https://api.github.com/repos/nodejs/node/labels/lib%20/%20src","name":"lib / src","color":"fad8c7","default":false},{"id":207521371,"url":"https://api.github.com/repos/nodejs/node/labels/process","name":"process","color":"00aaff","default":false},{"id":169485514,"url":"https://api.github.com/repos/nodejs/node/labels/semver-major","name":"semver-major","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-04T21:10:15Z","updated_at":"2016-12-05T18:13:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/10116","html_url":"https://github.com/nodejs/node/pull/10116","diff_url":"https://github.com/nodejs/node/pull/10116.diff","patch_url":"https://github.com/nodejs/node/pull/10116.patch"},"body":"##### Checklist\r\n- [x] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n\r\nprocess, lib\r\n\r\n##### Description of change\r\n\r\nAs discussed at the Node.js Interactive Collaboration Summit in Austin last week, this PR adds a few new capabilities that should make it easier to make dealing with runtime deprecation warnings in Node.js easier.\r\n\r\n1. A static identifier code can be assigned to all process warnings. These are specified as either a new optional argument to `process.emitWarning()` or as a `code` property on an `Error` object passed into `process.emitWarning()`. Within the `process.on('warning')` event handler, these can be accessed via the `code` property on the `warning` object.\r\n\r\n2. A new `--redirect-warnings=file` command line argument and matching `NODE_REDIRECT_WARNINGS=file` environment variable is added to allow process warning output to be printed to the given `file` as opposed to dumping to `stderr`. This will allow, for instance, npm and other applications spawning node process instances to capture warning output with less noise to the console.\r\n\r\n3. Every runtime and documentation-only deprecation in Node.js is assigned a static identifier code.\r\n\r\n4. A new deprecations.md file is added to the API documentation that lists each of the runtime and documentation-only deprecation codes assigned. For future work (perhaps a good first contribution for new Node.js contributors), it would be helpful to expand the details in deprecations.md to include links to the relevant sections in other parts of the API documentation as well as expanded descriptions of why the APIs are deprecated and what the alternatives are. /cc @nodejs/documentation \r\n\r\n*Note*: This PR is currently semver-major because it adds improved type checking to the input on `process.emitWarning()` to ensure that both the warning name and the identifier code are strings.\r\nIf this PR is backported to older Node.js release streams, the backport can be landed as a semver-minor *if and only if* the additional type checking on the `name` argument is removed.\r\n\r\n/cc @ashleygwilliams \r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/264930888","html_url":"https://github.com/nodejs/node/pull/10116#issuecomment-264930888","issue_url":"https://api.github.com/repos/nodejs/node/issues/10116","id":264930888,"user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T18:13:09Z","updated_at":"2016-12-05T18:13:09Z","body":"@silverwind ... I don't disagree, but as I said, this API already provides the option of passing in an `Error` object as the first argument. Given that, I don't see significant value in providing an options object"}}
{"actor":{"display_login":"jasnell"}}