Added a function to log last logs, in case of any crashes

This commit is contained in:
Kasper Rynning-Tønnesen
2019-03-21 20:53:44 +01:00
parent f3547cc028
commit d95ce57910
4 changed files with 26 additions and 6 deletions

View File

@@ -40,10 +40,14 @@ var Helper = {
}
console.log("------------ " + new Date() + " ------------");/*RemoveLogging:skip*/
}
Helper.logs.unshift({log: to_log, date: new Date()});
if(Helper.logs.length > 10) {
Helper.logs.splice(-1, Helper.logs.length - 10);
}
try {
if(to_log[0] != "FULL PLAYLIST") {
Helper.logs.unshift({log: to_log, date: new Date()});
if(Helper.logs.length > 10) {
Helper.logs.splice(-1, Helper.logs.length - 10);
}
}
} catch(e){}
},
rnd: function(arr) {