index.js
function BunyanFormatWritable (opts, out) {
  if (!(this instanceof BunyanFormatWritable)) return new BunyanFormatWritable(opts, out);

  opts = opts || {};
  opts.objectMode = true;
  Writable.call(this, opts);

  this.opts = xtend({ 
    outputMode: 'short', 
    color: true,
    colorFromLevel: {
      10: 'brightBlack',    // TRACE
      20: 'brightBlack',    // DEBUG
      30: 'green',          // INFO
      40: 'magenta',        // WARN
      50: 'red',            // ERROR
      60: 'brightRed',      // FATAL
    }
  }, opts);
  this.out = out || process.stdout;
}
function BunyanFormatWritable (opts, out) {
  if (!(this instanceof BunyanFormatWritable)) return new BunyanFormatWritable(opts, out);

  opts = opts || {};
  opts.objectMode = true;
  Writable.call(this, opts);

  this.opts = xtend({ 
    outputMode: 'short', 
    color: true,
    colorFromLevel: {
      10: 'brightBlack',    // TRACE
      20: 'brightBlack',    // DEBUG
      30: 'green',          // INFO
      40: 'magenta',        // WARN
      50: 'red',            // ERROR
      60: 'brightRed',      // FATAL
    }
  }, opts);
  this.out = out || process.stdout;
}
function BunyanFormatWritable ( opts , out ) { if ( ! ( this instanceof BunyanFormatWritable ) ) return new BunyanFormatWritable ( opts , out ) ; opts = opts || { } ; opts . objectMode = true ; Writable . call ( this , opts ) ; this . opts = xtend ( { outputMode : 'short' , color : true , colorFromLevel : { 10 : 'brightBlack' , // TRACE 20 : 'brightBlack' , // DEBUG 30 : 'green' , // INFO 40 : 'magenta' , // WARN 50 : 'red' , // ERROR 60 : 'brightRed' , // FATAL } } , opts ) ; this . out = out || process . stdout ; }
Creates a writable stream that formats bunyan records written to it.

@name BunyanFormatWritable
@function
@param opts {Options} passed to bunyan format function
- outputMode: short|long|simple|json|bunyan
- color (true): toggles colors in output
- colorFromLevel: allows overriding log level colors
@param out {Stream} (process.stdout) writable stream to write
@return {WritableStream} that you can pipe bunyan output into
Creates a writable stream that formats bunyan records written to it .