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 2020-04-06 18:03:12 -03:00 committed by Beth Griggs
parent d2c0800596
commit 25656109db
No known key found for this signature in database
GPG Key ID: D7062848A1AB005C

View File

@ -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);