Final touchs after the big Debug Log re organization

This commit is contained in:
Luis Fernando Molina committed 2018-06-07 01:35:10 +02:00
1 parent 2e28f86fd5
commit 149eb01e52
4 files changed
+38 -30

No files matched your search

+19 -11
View File
@@ -69,19 +69,26 @@
let fileName = "Loop." + pad(thisObject.bot.loopCounter, 8) + ".json";
cloudStorage.createTextFile(filePath, fileName, blobContent + '\r\n' + "]", onFileCreated);
writeLog();
function onFileCreated(err) {
function writeLog() {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> err = " + err.message);
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> filePath = " + filePath);
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> fileName = " + fileName);
return;
cloudStorage.createTextFile(filePath, fileName, blobContent + '\r\n' + "]", onFileCreated);
function onFileCreated(err) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> err = " + err.message);
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> filePath = " + filePath);
console.log("[ERROR] DebugLog -> persist -> onInizialized -> onFileCreated -> fileName = " + fileName);
setTimeout(writeLog, 10000); // Lets retry until we make it.
return;
}
blobContent = "";
thisObject = {};
}
blobContent = "";
thisObject = {};
}
} else {
@@ -122,7 +129,8 @@
if (pMessage.indexOf("[ERROR]") >= 0) {
console.log("AACloud" + spacePad(pModule, 50) + " : " + pMessage);
let now = new Date;
console.log(now.toUTCString() + " AACloud" + spacePad(pModule, 15) + " : " + pMessage);
}
}