We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87e0dda commit f36bee4Copy full SHA for f36bee4
lib/internal/util/debuglog.js
@@ -62,7 +62,7 @@ function lazyUtilColors() {
62
return utilColors;
63
}
64
65
-function debuglogImpl(enabled, set, args) {
+function debuglogImpl(enabled, set) {
66
if (debugImpls[set] === undefined) {
67
if (enabled) {
68
const pid = process.pid;
@@ -109,6 +109,8 @@ function debuglog(set, cb) {
109
return enabled;
110
};
111
const logger = (...args) => {
112
+ // Improve performance when debug is disabled, avoid calling `new SafeArrayIterator(args)`
113
+ if (enabled === false) return;
114
switch (args.length) {
115
case 1: return debug(args[0]);
116
case 2: return debug(args[0], args[1]);
0 commit comments