test: replace console.log/error with debuglog

Use utility debug logs instead of console logs
in test-cluster-setup-master-multiple.js

Refs: https://github.com/nodejs/node/issues/32678

PR-URL: https://github.com/nodejs/node/pull/32695
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
Agustin Daguerre authored and Michaël Zasso committed 2020-04-11 10:13:00 +02:00
1 parent a11e3ef912
commit bdb2df7e34
1 file changed
+3 -2
@@ -23,6 +23,7 @@
require('../common');
const assert = require('assert');
const cluster = require('cluster');
const debug = require('util').debuglog('test');
assert(cluster.isMaster);
@@ -36,7 +37,7 @@ const configs = [];
// Capture changes
cluster.on('setup', () => {
console.log('"setup" emitted', cluster.settings);
debug(`"setup" emitted ${JSON.stringify(cluster.settings)}`);
configs.push(cheapClone(cluster.settings));
});
@@ -65,5 +66,5 @@ execs.forEach((v, i) => {
// Cluster emits 'setup' asynchronously, so we must stay alive long
// enough for that to happen
setTimeout(() => {
console.log('cluster setup complete');
debug('cluster setup complete');
}, (execs.length + 1) * 100);