<script>
  var ChromeSamples = {
    log: function() {
      document.querySelector('#log').textContent += Array.prototype.join.call(arguments, '') + '\n';
    },

    setStatus: function(status) {
      document.querySelector('#status').textContent = status;
    },

    setContent: function(newContent) {
      var content = document.querySelector('#content');
      while(content.hasChildNodes()) {
        content.removeChild(content.lastChild);
      }
      content.appendChild(newContent);
    }
  };
</script>

<h3>Live Output</h3>
<div id="output" class="output">
  <div id="content">{{ include.initial_output_content }}</div>
  <div id="status"></div>
  <pre id="log"></pre>
</div>

<script>
  var ChromeSamples = {
    log: function() {
      var line = Array.prototype.slice.call(arguments).map(function(argument) {
        return typeof argument === 'string' ? argument : JSON.stringify(argument);
      }).join(' ');

      document.querySelector('#log').textContent += line + '\n';
    },

    setStatus: function(status) {
      document.querySelector('#status').textContent = status;
    },

    setContent: function(newContent) {
      var content = document.querySelector('#content');
      while(content.hasChildNodes()) {
        content.removeChild(content.lastChild);
      }
      content.appendChild(newContent);
    }
  };
</script>

<h3>Live Output</h3>
<div id="output" class="output">
  <div id="content">{{ include.initial_output_content }}</div>
  <div id="status"></div>
  <pre id="log"></pre>
</div>

Call JSON.stringify() on non-string arguments while logging
Call JSON.stringify() on non-string arguments while logging
