(Emscripten) Print logs to the browser console

This commit is contained in:
Rob Loach 2016-09-14 18:33:52 -04:00
parent a8f407ac33
commit ddccaeed8c
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
2 changed files with 3 additions and 29 deletions

View File

@ -129,16 +129,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group btn-group text-xs-center p-t-2">
<div class="card">
<div class="view overlay hm-white-slight" align="center">
<textarea id="output" rows="15"></textarea>
</div>
</div>
</div>
</div>
</div>
<div align="center">
<p>For now, we recommend you use <a href="https://www.google.com/chrome/">Google Chrome</a> for the best possible performance.</p>

View File

@ -239,25 +239,9 @@ var Module =
arguments: ["-v", "--menu"],
preRun: [],
postRun: [],
print: (function()
{
var element = document.getElementById('output');
element.value = ''; // clear browser cache
return function(text)
{
text = Array.prototype.slice.call(arguments).join(' ');
element.value += text + "\n";
element.scrollTop = 99999; // focus on bottom
};
})(),
printErr: function(text)
{
var text = Array.prototype.slice.call(arguments).join(' ');
var element = document.getElementById('output');
element.value += text + "\n";
element.scrollTop = 99999; // focus on bottom
},
// Print both stdout and stderr to the browser console.
print: console.log,
printErr: console.log,
canvas: document.getElementById('canvas'),
totalDependencies: 0,
monitorRunDependencies: function(left)