You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* remove DEBUG_FD
Now simply uses `process.stderr`. Breaking API change,
for the v3 branch.
Previously used internal and undocumented Node.js APIs to support
this underly used API.
Fixes#280Closes#386
* remove DEBUG_FD from readme
* The file descriptor to write the `debug()` calls to.
56
-
* Set the `DEBUG_FD` env variable to override with another value. i.e.:
57
-
*
58
-
* $ DEBUG_FD=3 node script.js 3>debug.log
59
-
*/
60
-
61
-
varfd=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)')()
65
-
}
66
-
67
-
varstream=1===fd ? process.stdout :
68
-
2===fd ? process.stderr :
69
-
createWritableStdioStream(fd);
70
-
71
54
/**
72
55
* Is stdout a TTY? Colored output is enabled when `true`.
73
56
*/
74
57
75
58
functionuseColors(){
76
59
return'colors'inexports.inspectOpts
77
60
? Boolean(exports.inspectOpts.colors)
78
-
: tty.isatty(fd);
61
+
: tty.isatty(process.stderr.fd);
79
62
}
80
63
81
64
/**
@@ -120,11 +103,11 @@ function formatArgs(args) {
120
103
}
121
104
122
105
/**
123
-
* Invokes `util.format()` with the specified arguments and writes to `stream`.
106
+
* Invokes `util.format()` with the specified arguments and writes to stderr.
0 commit comments