1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-10-31 23:31:48 +09:00

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