Skip to content

Commit 37e14d6

Browse files
pi0thebigredgeek
authored andcommitted
Whitelist DEBUG_FD for values 1 and 2 only Fixes #410 (#415)
* Hide in DEBUG_FD deprecation warning in Webstorm Fixes #410 + Intellij idea * Hide in DEBUG_FD deprecation warning in Webstorm Fixes #410 * whitelist DEBUG_FD for values 1 and 2 only * Use appreciate depreciation message
1 parent 705a9fe commit 37e14d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ exports.inspectOpts = Object.keys(process.env).filter(function (key) {
5858
* $ DEBUG_FD=3 node script.js 3>debug.log
5959
*/
6060

61-
if ('DEBUG_FD' in process.env) {
62-
util.deprecate(function(){}, '`DEBUG_FD` is deprecated. Override `debug.log` if you want to use a different log function (https://git.io/vMUyr)')()
61+
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
62+
63+
if (1 !== fd && 2 !== fd) {
64+
util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
6365
}
6466

65-
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
6667
var stream = 1 === fd ? process.stdout :
6768
2 === fd ? process.stderr :
6869
createWritableStdioStream(fd);

0 commit comments

Comments
 (0)