improve error handling and logging

This commit is contained in:
Ruben van de Ven 2020-09-28 11:29:45 +02:00
parent a6594f142b
commit cebfae6430
1 changed files with 3 additions and 3 deletions

View File

@ -457,12 +457,12 @@ if (event.reason && event.reason.message && event.reason.stack){
(function(){
const oldLog = console.log;
console.log = function () {
oldLog.apply(console, arguments);
console.log = function (...params) {
oldLog.apply(console, params);
const err = new Error();
const logSrc = err.stack.split("\n")[1];
const args = arguments.map((a) => ""+a); // to string
const args = params.map((a) => ""+a); // to string
window.parent.postMessage([{
log: [{
method: 'log',