From a2136f90f13f05b7b3aba8705def8b1446f591dd Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 11 Sep 2019 19:30:12 +0200 Subject: [PATCH] Better Logging --- DebugLog.js | 6 +++++- Root.js | 2 +- server.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DebugLog.js b/DebugLog.js index c5ae362da..5112b0882 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -130,7 +130,11 @@ exports.newDebugLog = function newDebugLog() { let logLine = '\r\n' + message; if (process.env.CONSOLE_LOG === "true" || message.indexOf("ERROR") > 0) { - console.log(message) + let key = '' + if (thisObject.bot) { + key = thisObject.bot.devTeam + '-' + thisObject.bot.codeName + '-' + thisObject.bot.process + } + console.log(message + ' @ ' + key) } accumulatedLog = accumulatedLog + logLine; diff --git a/Root.js b/Root.js index c16978526..ec9720690 100644 --- a/Root.js +++ b/Root.js @@ -663,7 +663,7 @@ function exitProcessInstance() { global.ENDED_PROCESSES_COUNTER++ - console.log("[INFO] Task Server -> exitProcessInstance -> Process #" + global.ENDED_PROCESSES_COUNTER + " from " + global.TOTAL_PROCESS_INSTANCES_CREATED + ' exiting.'); + console.log("[INFO] Task Server -> " + global.USER_DEFINITION.name + " -> exitProcessInstance -> Process #" + global.ENDED_PROCESSES_COUNTER + " from " + global.TOTAL_PROCESS_INSTANCES_CREATED + " exiting."); if (global.ENDED_PROCESSES_COUNTER === global.TOTAL_PROCESS_INSTANCES_CREATED) { global.EXIT_NODE_PROCESS() diff --git a/server.js b/server.js index 0f9438085..83640a8ac 100644 --- a/server.js +++ b/server.js @@ -129,7 +129,7 @@ global.EXIT_NODE_PROCESS = function exitProcess() { global.SYSTEM_EVENT_HANDLER.finalize() global.SYSTEM_EVENT_HANDLER = undefined - console.log("[INFO] Task Server -> exitProcessInstance -> Task Server Stopped."); + console.log("[INFO] Task Server -> " + global.USER_DEFINITION.name + " -> EXIT_NODE_PROCESS -> Task Server Stopped."); process.exit() }