for #761, add source back to console messages
This commit is contained in:
parent
00ea3bc281
commit
b70d62164c
2 changed files with 3 additions and 2 deletions
|
@ -81,7 +81,7 @@ class PreviewFrame extends React.Component {
|
||||||
|
|
||||||
handleConsoleEvent(messageEvent) {
|
handleConsoleEvent(messageEvent) {
|
||||||
if (Array.isArray(messageEvent.data)) {
|
if (Array.isArray(messageEvent.data)) {
|
||||||
const decodedMessages = messageEvent.data.map(message => Decode(message.log));
|
const decodedMessages = messageEvent.data.map(message => Object.assign(Decode(message.log), { source: message.source }));
|
||||||
|
|
||||||
decodedMessages.every((message, index, arr) => {
|
decodedMessages.every((message, index, arr) => {
|
||||||
const { data: args } = message;
|
const { data: args } = message;
|
||||||
|
|
|
@ -7,7 +7,8 @@ const consoleBuffer = [];
|
||||||
const LOGWAIT = 500;
|
const LOGWAIT = 500;
|
||||||
Hook(window.console, (log) => {
|
Hook(window.console, (log) => {
|
||||||
consoleBuffer.push({
|
consoleBuffer.push({
|
||||||
log
|
log,
|
||||||
|
source: 'sketch'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
|
Loading…
Reference in a new issue