diff --git a/src/node.js b/src/node.js index ea6a8967..4fa564b0 100644 --- a/src/node.js +++ b/src/node.js @@ -58,11 +58,12 @@ exports.inspectOpts = Object.keys(process.env).filter(function (key) { * $ DEBUG_FD=3 node script.js 3>debug.log */ -if ('DEBUG_FD' in process.env) { - util.deprecate(function(){}, '`DEBUG_FD` is deprecated. Override `debug.log` if you want to use a different log function (https://git.io/vMUyr)')() +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + 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)')() } -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);