util: named anonymous functions
PR-URL: https://github.com/nodejs/node/pull/20408 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
This commit is contained in:
parent
a00f76c360
commit
4d8806fc40
@ -276,12 +276,12 @@ function debuglog(set) {
|
||||
if (!debugs[set]) {
|
||||
if (debugEnvRegex.test(set)) {
|
||||
const pid = process.pid;
|
||||
debugs[set] = function() {
|
||||
debugs[set] = function debug() {
|
||||
const msg = exports.format.apply(exports, arguments);
|
||||
console.error('%s %d: %s', set, pid, msg);
|
||||
};
|
||||
} else {
|
||||
debugs[set] = function() {};
|
||||
debugs[set] = function debug() {};
|
||||
}
|
||||
}
|
||||
return debugs[set];
|
||||
|
Loading…
x
Reference in New Issue
Block a user