lib/stdlog.js
function logWriteableStream(stream, colorFunction) {
        var write = stream.write;
        
        // The third parameter, callback, will be passed implicitely using arguments
        stream.write = function (chunk, encoding) {
            // Write to STDOUT right away
            try {
                write.apply(this, arguments);
            } catch (streamWriteError) { }
            
            writeToLog(chunk, encoding, colorFunction);
        };
    }
function logWriteableStream(stream, colorFunction) {
        var write = stream.write;
        
        // The third parameter, callback, will be passed implicitely using arguments
        stream.write = function (chunk, encoding) {
            // Write to STDOUT right away
            try {
                write.apply(this, arguments);
            } catch (streamWriteError) { }
            
            writeToLog(chunk, encoding, colorFunction);
        };
    }
function logWriteableStream ( stream , colorFunction ) { var write = stream . write ; // The third parameter, callback, will be passed implicitely using arguments stream . write = function ( chunk , encoding ) { // Write to STDOUT right away try { write . apply ( this , arguments ) ; } catch ( streamWriteError ) { } writeToLog ( chunk , encoding , colorFunction ) ; } ; }
Tap a writable stream and write the data to the log file

@param {stream.Writable} stream
@param {function=} colorFunction optional function to apply color to the log message
Tap a writable stream and write the data to the log file