clusterlog

0.1.0 • Public • Published

Problem

console.log init messages for clustered apps are printed once per worker.

Solution

This simple logger which only outputs a unique line once it's been written by all workers

How

Each work gets a log function to call, which via process.send is conveyed to the master process, which then outputs it once all workers have sent that message. It's simply apply'ed to console.log at the master level, so it works exactly like console.log.

Installation

npm install clusterlog

Usage

var clusterlog = require('clusterlog'); clusterlog.log("Some message %s", "which works like console.log does");

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i clusterlog

    Weekly Downloads

    0

    Version

    0.1.0

    License

    WTFPL

    Last publish

    Collaborators

    • backhand