Skip to content

Commit

Permalink
test: replace console.log/error with debuglog
Browse files Browse the repository at this point in the history
Use utility debug logs instead of console logs
in test-cluster-setup-master-multiple.js

Refs: #32678

PR-URL: #32695
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
  • Loading branch information
agustindaguerre authored and targos committed Apr 22, 2020
1 parent ae772b7 commit 2f72054
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-cluster-setup-master-multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
require('../common');
const assert = require('assert');
const cluster = require('cluster');
const debug = require('util').debuglog('test');

assert(cluster.isMaster);

Expand All @@ -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));
});

Expand Down Expand Up @@ -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);

0 comments on commit 2f72054

Please sign in to comment.