Send prints to the browser console. Obvious in retrospect.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3840 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-13 22:39:22 +00:00
parent eb191254b0
commit a4a0745385
7 changed files with 85 additions and 3 deletions

View File

@ -486,6 +486,8 @@ function receive(message) {
}
}
console.log('error', message);
} else if (message && message.action == "print") {
console.log('app>', ...message.args);
} else if (message && message.action == "stats") {
var now = new Date().getTime();
for (var key of Object.keys(message.stats)) {

View File

@ -200,6 +200,9 @@ async function getProcessBlob(blobId, key, options) {
imports.app[api[0]] = process.app.makeFunction(api);
}
}
process.task.onPrint = function(args) {
process.app.send({action: 'print', args: args});
};
process.task.onError = function(error) {
try {
process.app.send({action: 'error', error: error});