title: Print to process.stdout.write with mocha
body: <p>I am writing a logging module for nodejs. I am using process.stdout.write to output my data, mostly to avoid the trailing new line that comes with console.log. However, the disadvantage to this is that mocha appears to write to this as well, so that my logging application displays no output. Is there anything I can do to avoid or get around this behavior?</p>
  
  <p><strong>Update</strong>: Whether or not process.stdout.write is displayed depends on the mocha reporter.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here is some code to reproduce what I am seeing:</p>
  
  <pre><code>//module.js
  exports.log = function(message, printmethod) {
  
  if(printmethod = 0)
    console.log(message);
  } 
  if(printmethod = 1) {
  
    process.stdout.write(message);
  
  }
  }
  
  
  //Mocha test:
  
  module = require('module');
  
  var message = "testing"; 
  
  describe("Testing Output", function () {
      it("Prints to console.log", function (done) {
  
          //This will show up in mocha output
          module.log(message, 0);
      done();
      })
      it("Prints to stdout", function (done) {
  
          //This won't show up in mocha output
          module.log(message, 1);
      done();
      })
  })
  </code></pre>