Rename clusterLog to clusterLogger (#4167)

This commit is contained in:
Aya Morisawa 2019-02-06 18:01:35 +09:00 committed by syuilo
parent bcd886c4f5
commit 61036e3a70

View File

@ -26,7 +26,7 @@ import { showMachineInfo } from './misc/show-machine-info';
const logger = new Logger('core', 'cyan'); const logger = new Logger('core', 'cyan');
const bootLogger = logger.createSubLogger('boot', 'magenta'); const bootLogger = logger.createSubLogger('boot', 'magenta');
const clusterLog = logger.createSubLogger('cluster', 'orange'); const clusterLogger = logger.createSubLogger('cluster', 'orange');
const ev = new Xev(); const ev = new Xev();
/** /**
@ -249,19 +249,19 @@ function spawnWorker(): Promise<void> {
// Listen new workers // Listen new workers
cluster.on('fork', worker => { cluster.on('fork', worker => {
clusterLog.debug(`Process forked: [${worker.id}]`); clusterLogger.debug(`Process forked: [${worker.id}]`);
}); });
// Listen online workers // Listen online workers
cluster.on('online', worker => { cluster.on('online', worker => {
clusterLog.debug(`Process is now online: [${worker.id}]`); clusterLogger.debug(`Process is now online: [${worker.id}]`);
}); });
// Listen for dying workers // Listen for dying workers
cluster.on('exit', worker => { cluster.on('exit', worker => {
// Replace the dead worker, // Replace the dead worker,
// we're not sentimental // we're not sentimental
clusterLog.error(chalk.red(`[${worker.id}] died :(`)); clusterLogger.error(chalk.red(`[${worker.id}] died :(`));
cluster.fork(); cluster.fork();
}); });