Adds download logs method for debugging.
Adds a download logs method that can be called from console to take usefull messages for debugging. console> APP.conference.saveLogs();
This commit is contained in:
parent
4fdc11c6fb
commit
bbc7aedb48
|
@ -711,6 +711,30 @@ export default {
|
||||||
return room.getLogs();
|
return room.getLogs();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download logs, a function that can be called from console while
|
||||||
|
* debugging.
|
||||||
|
* @param filename (optional) specify target filename
|
||||||
|
*/
|
||||||
|
saveLogs (filename = 'meetlog.json') {
|
||||||
|
// this can be called from console and will not have reference to this
|
||||||
|
// that's why we reference the global var
|
||||||
|
let logs = APP.conference.getLogs();
|
||||||
|
let data = encodeURIComponent(JSON.stringify(logs, null, ' '));
|
||||||
|
|
||||||
|
let elem = document.createElement('a');
|
||||||
|
|
||||||
|
elem.download = filename;
|
||||||
|
elem.href = 'data:application/json;charset=utf-8,\n' + data;
|
||||||
|
elem.dataset.downloadurl
|
||||||
|
= ['text/json', elem.download, elem.href].join(':');
|
||||||
|
elem.dispatchEvent(new MouseEvent('click', {
|
||||||
|
view: window,
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: false
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exposes a Command(s) API on this instance. It is necessitated by (1) the
|
* Exposes a Command(s) API on this instance. It is necessitated by (1) the
|
||||||
* desire to keep room private to this instance and (2) the need of other
|
* desire to keep room private to this instance and (2) the need of other
|
||||||
|
|
Loading…
Reference in New Issue