lib/logger.js
/**
 * Logs message. Forwards message from child process to master
 * @param {String} message
 * @private
 */
Logs message. Forwards message from child process to master
@param {String} message
@private
Logs message . Forwards message from child process to master @param { String } message @private
function _log(message) {
    if (cluster.isMaster) {
        console.log(_format(message));
    }
    else {
        cluster.worker.process.send({
            type: "logging",
            data: {
                message: message,
                workerID: cluster.worker.id,
                pid: cluster.worker.process.pid
            }
        });
    }
}
function _log ( message ) { if ( cluster . isMaster ) { console . log ( _format ( message ) ) ; } else { cluster . worker . process . send ( { type : "logging" , data : { message : message , workerID : cluster . worker . id , pid : cluster . worker . process . pid } } ) ; } }
Logs message.
Logs message .
// write directly to the log file // send to master