From 5350863a614c33ec4861e5805c1b4ad128833759 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 23 Jan 2017 11:53:44 +0330 Subject: [PATCH] whitelist DEBUG_FD for values 1 and 2 only --- src/node.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node.js b/src/node.js index 90dcf944..599da95c 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 && !('DEBUG_COLORS' in process.env && process.env.DEBUG_FD == 1)) { - 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(){}, '`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);