title: How to reroute console.log to document.write
body: <p>I would like to create a "Console" app for JavaScript so that messages are written to the screen.</p>
  
  <pre><code>console.log("Rerouting log messages to the screen");
  console.log = function (message) { document.writeln(message); };
  console.log("Log messages are now routed to the screen.");
  </code></pre>
  
  <p>This works, except that each time something is written to the screen, it wipes out any existing content.</p>
  
  <p>Is there a way to do this?</p>